Interface Row
-
public interface Row
Represents a row within the store.The individual fields of the row can themselves be NestableTuples(representing nested data structures). There can also be repeated fields, which is a bit of an extension on standard SQL types.
The intent of this class is to represent a single result in a set of results in a generic form.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<Row>
getArray(int position)
Get the value at the specified position, as a sequence of nested rows.byte[]
getBytes(int position)
Get the value at the specified position, as a byte[].double
getDouble(int position)
Get the value at the specified position, as a double.float
getFloat(int position)
Get the value at the specified position, as a float.long
getLong(int position)
Get the value at the specified position, as a long.int
getNumFields()
Get the number of fields in this row.java.lang.Object
getObject(int position)
Get the value at the specified position, as an Object.Row
getPrefix(int length)
Get a prefix of this row as a row.Row
getRow(int position)
Get the value at the specified position, as a nested row.java.lang.String
getString(int position)
Get the value at the specified position, as a String.boolean
startsWith(Row prefix)
Checks if this row starts with a given prefix.
-
-
-
Method Detail
-
getNumFields
int getNumFields()
Get the number of fields in this row.- Returns:
- the number of fields in the row.
-
getLong
long getLong(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a long.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as a long.
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to a longInvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getFloat
float getFloat(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a float.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as a float.
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to an floatInvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getDouble
double getDouble(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a double.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as a double.
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to a doubleInvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getString
java.lang.String getString(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a String.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as a string.
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to a stringInvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getBytes
byte[] getBytes(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a byte[].- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as a byte[].
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to a byte[]InvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getRow
Row getRow(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a nested row.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as a Row
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to a RowInvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getArray
java.lang.Iterable<Row> getArray(int position) throws InvalidTypeException, InvalidColumnReferenceException
Get the value at the specified position, as a sequence of nested rows.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as an iterable
- Throws:
InvalidTypeException
- if the field at the position cannot be converted to a RowInvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
getObject
java.lang.Object getObject(int position) throws InvalidColumnReferenceException
Get the value at the specified position, as an Object.- Parameters:
position
- the position in the row- Returns:
- the value of the row at the specified position, as an Object.
- Throws:
InvalidColumnReferenceException
- ifposition < 0
orposition >=
getNumFields()
-
startsWith
boolean startsWith(Row prefix)
Checks if this row starts with a given prefix.- Parameters:
prefix
- the prefix to check against- Returns:
- true if this row starts with the correct prefix, false otherwise
-
getPrefix
Row getPrefix(int length)
Get a prefix of this row as a row.- Parameters:
length
- The length of the prefix- Returns:
- a prefix Row
-
-