Class BlockContext
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<java.lang.String,java.lang.Object>
-
- com.inductiveautomation.ignition.gateway.sqltags.history.query.processing.BlockContext
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.Object>
public class BlockContext extends java.util.HashMap<java.lang.String,java.lang.Object>
A BlockContext provides some information about a specific aggregation "block", or window of time, but it also provides a spot for aggregation functions to store data for the window, if they want. It also provides a series of useful functions for aggregation functions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BlockContext(long blockStart, long blockEnd, int blockId, QualifiedValue prevRaw, QualifiedValue[] prevRes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get(java.lang.String key, java.lang.Object def)
long
getBlockEnd()
int
getBlockId()
Returns an integer that roughly corresponds to the rowid of the result that this block would represent.long
getBlockStart()
java.util.Date
getBlockTimestamp()
java.lang.Object
getReturnValue()
boolean
insideBlock(long time)
boolean
insideBlock(java.util.Date time)
QualifiedValue[]
previousBlockResults()
Returns the results from the previous aggregation functionQualifiedValue
previousRawValue()
Returns the last raw value received previous to this block.void
setReturn(java.lang.Object object)
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
BlockContext
public BlockContext(long blockStart, long blockEnd, int blockId, QualifiedValue prevRaw, QualifiedValue[] prevRes)
-
-
Method Detail
-
getBlockId
public int getBlockId()
Returns an integer that roughly corresponds to the rowid of the result that this block would represent. It is "roughly" because it doesn't take into account aggregates that return multiple values for one block.
-
getBlockTimestamp
public java.util.Date getBlockTimestamp()
-
getBlockStart
public long getBlockStart()
-
getBlockEnd
public long getBlockEnd()
-
previousRawValue
public QualifiedValue previousRawValue()
Returns the last raw value received previous to this block.
-
previousBlockResults
public QualifiedValue[] previousBlockResults()
Returns the results from the previous aggregation function
-
insideBlock
public boolean insideBlock(long time)
-
insideBlock
public boolean insideBlock(java.util.Date time)
-
get
public java.lang.Object get(java.lang.String key, java.lang.Object def)
-
setReturn
public void setReturn(java.lang.Object object)
-
getReturnValue
public java.lang.Object getReturnValue()
-
-