- java.lang.Object
-
- com.pervasive.datarush.operators.group.ReadableStorage
-
public final class ReadableStorage extends Object
Storage class by which a custom aggregator can load 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 ReadableStorage(ScalarValued[] internals)
Create a new readable storage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBinaryRef(int offset)
Returns the value of the internal element at the given offset.boolean
getBoolean(int offset)
Returns the value of the internal element at the given offset.char
getChar(int offset)
Returns the value of the internal element at the given offset.long
getDateEpochDays(int offset)
Returns the value of the internal element at the given offset.double
getDouble(int offset)
Returns the value of the internal element at the given offset.float
getFloat(int offset)
Returns the value of the internal element at the given offset.int
getInt(int offset)
Returns the value of the internal element at the given offset.long
getLong(int offset)
Returns the value of the internal element at the given offset.long
getMoney(int offset)
Returns the value of the internal element at the given offset.BigDecimal
getNumeric(int offset)
Returns the value of the internal element at the given offset.Object
getObject(int offset)
Returns the value of the internal element at the given offset.ScalarValued
getScalarValued(int offset)
Returns the value of the internal element at the given offset.String
getString(int offset)
Returns the value of the internal element at the given offset.int
getTimeDayMillis(int offset)
Returns the value of the internal element at the given offset.
-
-
-
Constructor Detail
-
ReadableStorage
public ReadableStorage(ScalarValued[] internals)
Create a new readable storage.- Parameters:
internals
- the array of internals.
-
-
Method Detail
-
getDouble
public double getDouble(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeDoubleValued
-
getNumeric
public BigDecimal getNumeric(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeNumericValued
-
getMoney
public long getMoney(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeMoneyValued
-
getLong
public long getLong(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeLongValued
-
getObject
public Object getObject(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeObjectValued
-
getScalarValued
public ScalarValued getScalarValued(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the value of the internal element at the given offset.
- Throws:
ArrayIndexOutOfBoundsException
- if the given offset is larger than the number ofinternalTypes
.
-
getBinaryRef
public byte[] getBinaryRef(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeBinaryValued
-
getBoolean
public boolean getBoolean(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeBooleanValued
.
-
getChar
public char getChar(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeCharValued
.
-
getDateEpochDays
public long getDateEpochDays(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeDateValued
.
-
getInt
public int getInt(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeIntValued
.
-
getString
public String getString(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeStringValued
.
-
getFloat
public float getFloat(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeFloatValued
.
-
getTimeDayMillis
public int getTimeDayMillis(int offset)
Returns the value of the internal element at the given offset.- Parameters:
offset
- the offset of the internal element.- Returns:
- the 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 typeTimeValued
.
-
-