java.lang.Object
com.pervasive.datarush.operators.group.WriteableStorage
Storage class by which a custom aggregator can storage its internals. An aggregator's
internals correspond element-by-element with the
internalTypes
that the aggregator declared.
Needed only for writing custom Aggregator; consumers of the API
should not need to use this class.-
Constructor Summary
ConstructorsConstructorDescriptionWriteableStorage(ScalarSettable[] internals) Create a new writeable storage. -
Method Summary
Modifier and TypeMethodDescriptiongetScalarSettable(int offset) Gets a mutable handle to the internal element at the given offset.voidsetBinaryRef(int offset, byte[] value) Sets the value of the internal element at the given offset.voidsetBoolean(int offset, boolean value) Sets the value of the internal element at the given offset.voidsetChar(int offset, char value) Sets the value of the internal element at the given offset.voidsetDateEpochDays(int offset, long value) Sets the value of the internal element at the given offset.voidsetDouble(int offset, double value) Sets the value of the internal element at the given offset.voidsetFloat(int offset, float value) Sets the value of the internal element at the given offset.voidsetInt(int offset, int value) Sets the value of the internal element at the given offset.voidsetLong(int offset, long value) Sets the value of the internal element at the given offset.voidsetMoney(int offset, long value) Sets the value of the internal element at the given offset.voidsetNumeric(int offset, BigDecimal value) Sets the value of the internal element at the given offset.voidSets the value of the internal element at the given offset.voidSets the value of the internal element at the given offset.voidsetTimeDayMillis(int offset, int value) Sets the value of the internal element at the given offset.voidsetTimestamp(int offset, long seconds, int nanos, int offsetSeconds) Sets the value of the internal element at the given offset.
-
Constructor Details
-
WriteableStorage
Create a new writeable storage.- Parameters:
internals- the array of internals.
-
-
Method Details
-
setObject
Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeObjectSettable
-
setDouble
public void setDouble(int offset, double value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeDoubleSettable
-
setNumeric
Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeNumericSettable
-
setMoney
public void setMoney(int offset, long value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeLongSettable
-
setLong
public void setLong(int offset, long value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeLongSettable
-
getScalarSettable
Gets a mutable handle to the internal element at the given offset.- Parameters:
offset- the offset of the internal element.- Returns:
- a handle that can be used to mutate the internal value at the given offset
- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.
-
setBinaryRef
public void setBinaryRef(int offset, byte[] value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeBinarySettable
-
setBoolean
public void setBoolean(int offset, boolean value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeBooleanSettable
-
setChar
public void setChar(int offset, char value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeCharSettable
-
setDateEpochDays
public void setDateEpochDays(int offset, long value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeDateSettable
-
setInt
public void setInt(int offset, int value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeIntSettable
-
setString
Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeStringSettable
-
setTimeDayMillis
public void setTimeDayMillis(int offset, int value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeTimeSettable
-
setTimestamp
public void setTimestamp(int offset, long seconds, int nanos, int offsetSeconds) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.seconds- number of seconds since Java epochnanos- fractional portion of epoch time in nanosecondsoffsetSeconds- time zone and daylight saving time offset, in seconds- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeTimestampSettable
-
setFloat
public void setFloat(int offset, float value) Sets the value of the internal element at the given offset.- Parameters:
offset- the offset of the internal element.value- the new value of the internal element at the given offset.- Throws:
ArrayIndexOutOfBoundsException- if the given offset is larger than the number ofinternalTypes.ClassCastException- if theinternalTypeat the given offset is not of typeFloatSettable
-