public abstract class AbstractStructReader extends Object implements StructReader
StructReader
implementations.
This class implements the majority of the StructReader
interface, leaving subclasses
to implement core data access via the getTypeNameInternal()
methods. AbstractStructReader
guarantees that these will only be called for non-NULL
columns of a
type appropriate for the method.
Constructor and Description |
---|
AbstractStructReader() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNonNull(int columnIndex,
Object columnNameForError) |
boolean |
getBoolean(int columnIndex)
Returns the value of a non-
NULL column with type Type.bool() . |
boolean |
getBoolean(String columnName)
Returns the value of a non-
NULL column with type Type.bool() . |
boolean[] |
getBooleanArray(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.bool()) . |
boolean[] |
getBooleanArray(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.bool()) . |
protected abstract boolean[] |
getBooleanArrayInternal(int columnIndex) |
protected abstract boolean |
getBooleanInternal(int columnIndex) |
List<Boolean> |
getBooleanList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.bool()) . |
List<Boolean> |
getBooleanList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.bool()) . |
protected abstract List<Boolean> |
getBooleanListInternal(int columnIndex) |
ByteArray |
getBytes(int columnIndex)
Returns the value of a non-
NULL column with type Type.bytes() . |
ByteArray |
getBytes(String columnName)
Returns the value of a non-
NULL column with type Type.bytes() . |
protected abstract ByteArray |
getBytesInternal(int columnIndex) |
List<ByteArray> |
getBytesList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.bytes()) . |
List<ByteArray> |
getBytesList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.bytes()) . |
protected abstract List<ByteArray> |
getBytesListInternal(int columnIndex) |
int |
getColumnCount()
Returns the number of columns in the underlying data.
|
int |
getColumnIndex(String columnName)
Returns the index of the column named
columnName . |
Type |
getColumnType(int columnIndex)
Returns the type of a column.
|
Type |
getColumnType(String columnName)
Returns the type of a column.
|
Date |
getDate(int columnIndex)
Returns the value of a non-
NULL column with type Type.date() . |
Date |
getDate(String columnName)
Returns the value of a non-
NULL column with type Type.date() . |
protected abstract Date |
getDateInternal(int columnIndex) |
List<Date> |
getDateList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.date()) . |
List<Date> |
getDateList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.date()) . |
protected abstract List<Date> |
getDateListInternal(int columnIndex) |
double |
getDouble(int columnIndex)
Returns the value of a non-
NULL column with type Type.float64() . |
double |
getDouble(String columnName)
Returns the value of a non-
NULL column with type Type.float64() . |
double[] |
getDoubleArray(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.float64()) . |
double[] |
getDoubleArray(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.float64()) . |
protected abstract double[] |
getDoubleArrayInternal(int columnIndex) |
protected abstract double |
getDoubleInternal(int columnIndex) |
List<Double> |
getDoubleList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.float64()) . |
List<Double> |
getDoubleList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.float64()) . |
protected abstract List<Double> |
getDoubleListInternal(int columnIndex) |
long |
getLong(int columnIndex)
Returns the value of a non-
NULL column with type Type.int64() . |
long |
getLong(String columnName)
Returns the value of a non-
NULL column with type Type.int64() . |
long[] |
getLongArray(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.int64()) . |
long[] |
getLongArray(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.int64()) . |
protected abstract long[] |
getLongArrayInternal(int columnIndex) |
protected abstract long |
getLongInternal(int columnIndex) |
List<Long> |
getLongList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.int64()) . |
List<Long> |
getLongList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.int64()) . |
protected abstract List<Long> |
getLongListInternal(int columnIndex) |
String |
getString(int columnIndex)
Returns the value of a non-
NULL column with type Type.string() . |
String |
getString(String columnName)
Returns the value of a non-
NULL column with type Type.string() . |
protected abstract String |
getStringInternal(int columnIndex) |
List<String> |
getStringList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.string()) . |
List<String> |
getStringList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.string()) . |
protected abstract List<String> |
getStringListInternal(int columnIndex) |
List<Struct> |
getStructList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.struct(...)) . |
List<Struct> |
getStructList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.struct(...)) . |
protected abstract List<Struct> |
getStructListInternal(int columnIndex) |
Timestamp |
getTimestamp(int columnIndex)
Returns the value of a non-
NULL column with type Type.timestamp() . |
Timestamp |
getTimestamp(String columnName)
Returns the value of a non-
NULL column with type Type.timestamp() . |
protected abstract Timestamp |
getTimestampInternal(int columnIndex) |
List<Timestamp> |
getTimestampList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.timestamp()) . |
List<Timestamp> |
getTimestampList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.timestamp()) . |
protected abstract List<Timestamp> |
getTimestampListInternal(int columnIndex) |
boolean |
isNull(String columnName)
Returns
true if a column contains a NULL value. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType, isNull
protected abstract boolean getBooleanInternal(int columnIndex)
protected abstract long getLongInternal(int columnIndex)
protected abstract double getDoubleInternal(int columnIndex)
protected abstract String getStringInternal(int columnIndex)
protected abstract ByteArray getBytesInternal(int columnIndex)
protected abstract Timestamp getTimestampInternal(int columnIndex)
protected abstract Date getDateInternal(int columnIndex)
protected abstract boolean[] getBooleanArrayInternal(int columnIndex)
protected abstract long[] getLongArrayInternal(int columnIndex)
protected abstract double[] getDoubleArrayInternal(int columnIndex)
protected abstract List<Timestamp> getTimestampListInternal(int columnIndex)
public int getColumnCount()
StructReader
NULL
values.getColumnCount
in interface StructReader
public Type getColumnType(int columnIndex)
StructReader
getColumnType
in interface StructReader
public Type getColumnType(String columnName)
StructReader
getColumnType
in interface StructReader
public boolean isNull(String columnName)
StructReader
true
if a column contains a NULL
value.isNull
in interface StructReader
public boolean getBoolean(int columnIndex)
StructReader
NULL
column with type Type.bool()
.getBoolean
in interface StructReader
public boolean getBoolean(String columnName)
StructReader
NULL
column with type Type.bool()
.getBoolean
in interface StructReader
public long getLong(int columnIndex)
StructReader
NULL
column with type Type.int64()
.getLong
in interface StructReader
public long getLong(String columnName)
StructReader
NULL
column with type Type.int64()
.getLong
in interface StructReader
public double getDouble(int columnIndex)
StructReader
NULL
column with type Type.float64()
.getDouble
in interface StructReader
public double getDouble(String columnName)
StructReader
NULL
column with type Type.float64()
.getDouble
in interface StructReader
public String getString(int columnIndex)
StructReader
NULL
column with type Type.string()
.getString
in interface StructReader
public String getString(String columnName)
StructReader
NULL
column with type Type.string()
.getString
in interface StructReader
public ByteArray getBytes(int columnIndex)
StructReader
NULL
column with type Type.bytes()
.getBytes
in interface StructReader
public ByteArray getBytes(String columnName)
StructReader
NULL
column with type Type.bytes()
.getBytes
in interface StructReader
public Timestamp getTimestamp(int columnIndex)
StructReader
NULL
column with type Type.timestamp()
.getTimestamp
in interface StructReader
public Timestamp getTimestamp(String columnName)
StructReader
NULL
column with type Type.timestamp()
.getTimestamp
in interface StructReader
public Date getDate(int columnIndex)
StructReader
NULL
column with type Type.date()
.getDate
in interface StructReader
public Date getDate(String columnName)
StructReader
NULL
column with type Type.date()
.getDate
in interface StructReader
public boolean[] getBooleanArray(int columnIndex)
StructReader
NULL
column with type Type.array(Type.bool())
.getBooleanArray
in interface StructReader
public boolean[] getBooleanArray(String columnName)
StructReader
NULL
column with type Type.array(Type.bool())
.getBooleanArray
in interface StructReader
public List<Boolean> getBooleanList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.bool())
.getBooleanList
in interface StructReader
public List<Boolean> getBooleanList(String columnName)
StructReader
NULL
column with type Type.array(Type.bool())
.getBooleanList
in interface StructReader
public long[] getLongArray(int columnIndex)
StructReader
NULL
column with type Type.array(Type.int64())
.getLongArray
in interface StructReader
public long[] getLongArray(String columnName)
StructReader
NULL
column with type Type.array(Type.int64())
.getLongArray
in interface StructReader
public List<Long> getLongList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.int64())
.getLongList
in interface StructReader
public List<Long> getLongList(String columnName)
StructReader
NULL
column with type Type.array(Type.int64())
.getLongList
in interface StructReader
public double[] getDoubleArray(int columnIndex)
StructReader
NULL
column with type Type.array(Type.float64())
.getDoubleArray
in interface StructReader
public double[] getDoubleArray(String columnName)
StructReader
NULL
column with type Type.array(Type.float64())
.getDoubleArray
in interface StructReader
public List<Double> getDoubleList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.float64())
.getDoubleList
in interface StructReader
public List<Double> getDoubleList(String columnName)
StructReader
NULL
column with type Type.array(Type.float64())
.getDoubleList
in interface StructReader
public List<String> getStringList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.string())
.getStringList
in interface StructReader
public List<String> getStringList(String columnName)
StructReader
NULL
column with type Type.array(Type.string())
.getStringList
in interface StructReader
public List<ByteArray> getBytesList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.bytes())
.getBytesList
in interface StructReader
public List<ByteArray> getBytesList(String columnName)
StructReader
NULL
column with type Type.array(Type.bytes())
.getBytesList
in interface StructReader
public List<Timestamp> getTimestampList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.timestamp())
.getTimestampList
in interface StructReader
public List<Timestamp> getTimestampList(String columnName)
StructReader
NULL
column with type Type.array(Type.timestamp())
.getTimestampList
in interface StructReader
public List<Date> getDateList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.date())
.getDateList
in interface StructReader
public List<Date> getDateList(String columnName)
StructReader
NULL
column with type Type.array(Type.date())
.getDateList
in interface StructReader
public List<Struct> getStructList(int columnIndex)
StructReader
NULL
column with type Type.array(Type.struct(...))
.getStructList
in interface StructReader
public List<Struct> getStructList(String columnName)
StructReader
NULL
column with type Type.array(Type.struct(...))
.getStructList
in interface StructReader
public int getColumnIndex(String columnName)
StructReader
columnName
.getColumnIndex
in interface StructReader
protected void checkNonNull(int columnIndex, Object columnNameForError)
Copyright © 2019 Google LLC. All rights reserved.