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
Modifier and TypeMethodDescriptiongetArray
(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
Get the number of fields in this row.getObject
(int position) Get the value at the specified position, as an Object.getPrefix
(int length) Get a prefix of this row as a row.getRow
(int position) Get the value at the specified position, as a nested row.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 Details
-
getNumFields
int getNumFields()Get the number of fields in this row.- Returns:
- the number of fields in the row.
-
getLong
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
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
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
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
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
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
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
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
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
Get a prefix of this row as a row.- Parameters:
length
- The length of the prefix- Returns:
- a prefix Row
-