Package net.solarnetwork.domain.datum
Class DatumSamplesExpressionRoot
- All Implemented Interfaces:
Map<String,,Object> DatumExpressionRoot,DatumMathFunctions
public class DatumSamplesExpressionRoot
extends AbstractMap<String,Object>
implements DatumExpressionRoot, DatumMathFunctions
An expression root object implementation that acts like a composite map of
parameters, sample data, and datum properties.
The Map implementation treats the given Datum,
DatumSamplesOperations, and parameter Map as a single
Map, where keys are handled by returning the first found
non-null value in the following order:
- parameter
Map - the
DatumSamplesOperationssample, following theInstantaneous,Accumulating, andStatuspriority defined inDatumSamplesOperations.findSampleValue(String) - if the
DatumimplementsDatum, then callDatum.asSampleOperations()and follow theDatumSamplesOperations.findSampleValue(String)rules again on that
- Since:
- 1.71
- Version:
- 2.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionDatumSamplesExpressionRoot(Datum datum, DatumSamplesOperations sample, Map<String, ?> parameters) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) entrySet()getData()Get the data map.getDatum()Get the datum.Get optional additional parameters.getProps()Get the property map.Get the samples.final Collection<? extends Number>Group a set of properties matching a pattern into a collection.booleanAn alias forcontainsKey(Object)Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.domain.datum.DatumMathFunctions
and, andNot, avg, ceil, ceil, decimal, down, down, floor, floor, integer, max, max, min, min, mround, narrow, narrow16, narrow32, narrow64, narrow8, not, or, round, round, roundDown, roundUp, shiftLeft, shiftRight, sum, testBit, up, up, xorMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
DatumSamplesExpressionRoot
public DatumSamplesExpressionRoot(Datum datum, DatumSamplesOperations sample, Map<String, ?> parameters) Constructor.- Parameters:
datum- the datum currently being populatedsample- the samplesparameters- the parameters
-
-
Method Details
-
getDatum
Description copied from interface:DatumExpressionRootGet the datum.- Specified by:
getDatumin interfaceDatumExpressionRoot- Returns:
- the datum; may be null
-
getSamples
Get the samples.This may or may not be the same samples as returned by
Datum.asSampleOperations()on theDatumreturned bygetDatum().- Returns:
- the datum samples; may be null
-
getParameters
Get optional additional parameters.- Returns:
- the parameters; may be null
-
getData
Get the data map.This method returns this object.
- Specified by:
getDatain interfaceDatumExpressionRoot- Returns:
- this object
-
getProps
Get the property map.This method returns this object.
- Specified by:
getPropsin interfaceDatumExpressionRoot- Returns:
- this object
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object> - Overrides:
containsKeyin classAbstractMap<String,Object>
-
has
An alias forcontainsKey(Object)- Parameters:
key- the key to search for- Returns:
- true if a property with the given key exists
-
get
-
entrySet
-
group
Group a set of properties matching a pattern into a collection.- Parameters:
pattern- the property name pattern to group- Returns:
- the group of matching properties, never null
- Since:
- 2.1
-