- java.lang.Object
-
- com.pervasive.datarush.operators.group.WriteableStorage
-
public final class WriteableStorage extends Object
Storage class by which a custom aggregator can storage its internals. An aggregator's internals correspond element-by-element with theinternalTypes
that the aggregator declared. Needed only for writing customAggregator
; consumers of the API should not need to use this class.
-
-
Constructor Summary
Constructors Constructor Description WriteableStorage(ScalarSettable[] internals)
Create a new writeable storage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScalarSettable
getScalarSettable(int offset)
Gets a mutable handle to the internal element at the given offset.void
setBinaryRef(int offset, byte[] value)
Sets the value of the internal element at the given offset.void
setBoolean(int offset, boolean value)
Sets the value of the internal element at the given offset.void
setChar(int offset, char value)
Sets the value of the internal element at the given offset.void
setDateEpochDays(int offset, long value)
Sets the value of the internal element at the given offset.void
setDouble(int offset, double value)
Sets the value of the internal element at the given offset.void
setFloat(int offset, float value)
Sets the value of the internal element at the given offset.void
setInt(int offset, int value)
Sets the value of the internal element at the given offset.void
setLong(int offset, long value)
Sets the value of the internal element at the given offset.void
setMoney(int offset, long value)
Sets the value of the internal element at the given offset.void
setNumeric(int offset, BigDecimal value)
Sets the value of the internal element at the given offset.void
setObject(int offset, Object value)
Sets the value of the internal element at the given offset.void
setString(int offset, String value)
Sets the value of the internal element at the given offset.void
setTimeDayMillis(int offset, int value)
Sets the value of the internal element at the given offset.void
setTimestamp(int offset, long seconds, int nanos, int offsetSeconds)
Sets the value of the internal element at the given offset.
-
-
-
Constructor Detail
-
WriteableStorage
public WriteableStorage(ScalarSettable[] internals)
Create a new writeable storage.- Parameters:
internals
- the array of internals.
-
-
Method Detail
-
setObject
public void setObject(int offset, Object 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 theinternalType
at 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 theinternalType
at the given offset is not of typeDoubleSettable
-
setNumeric
public void setNumeric(int offset, BigDecimal 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 theinternalType
at 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 theinternalType
at 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 theinternalType
at the given offset is not of typeLongSettable
-
getScalarSettable
public ScalarSettable getScalarSettable(int offset)
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 theinternalType
at 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 theinternalType
at 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 theinternalType
at 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 theinternalType
at 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 theinternalType
at the given offset is not of typeIntSettable
-
setString
public void setString(int offset, String 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 theinternalType
at 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 theinternalType
at 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 theinternalType
at 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 theinternalType
at the given offset is not of typeFloatSettable
-
-