|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.apama.correlator.memstore.RowValueHelper
public class RowValueHelper
Helper class for more conveniently and efficiently dealing with RowValue objects for a given table schema.
RowValueHelper is an immutable (and therefore thread-safe) object, which caches computed information about the schema during construction, so typical usage is to re-use a single instance of the helper as needed for all RowValue instances that have the same schema.
See RowValue
Javadoc for example usage.
Constructor Summary | |
---|---|
RowValueHelper(java.lang.String... schemaTypes)
Create a new RowValueHelper based on the specified schema type information. |
Method Summary | |
---|---|
RowValue |
createRowValue()
Create a new RowValue instance, with its data structured pre-allocated for the field types of this schema. |
java.lang.Iterable<java.lang.Object> |
fieldValues(RowValue rv)
Use the schema to iterate over each field in the specified row value, returning a Java Object of the correct type for each field value. |
int |
getTypedIndex(int fieldIndex)
Use the schema types to get the typedIndex (suitable for a RowValue.set/get call) from a fieldIndex. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RowValueHelper(java.lang.String... schemaTypes)
Do not create a new RowValueHelper for every RowValue, instead it is more efficient to reuse a single helper for many RowValue objects.
schemaTypes
- A params array indicating the type and order of fields in
this table's schema.Method Detail |
---|
public RowValue createRowValue()
public int getTypedIndex(int fieldIndex)
The correctness of this method is dependent on valid schema information being supplied - this method will return an out of range index if the schema and RowValue do not match, or if an invalid fieldIndex is specified (but it will not throw an exception).
fieldIndex
- The field index, i.e. n where n is the nth field in the row.
public java.lang.Iterable<java.lang.Object> fieldValues(RowValue rv)
rv
- The RowValue
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |