public abstract class AbstractCursor extends Object implements Cursor
Derived class needs to provide AbstractCursor.Getter and can override
Cursor.Accessor implementations if it
wishes.
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractCursor.AbstractGetter
Abstract implementation of
AbstractCursor.Getter. |
(package private) static class |
AbstractCursor.AccessorImpl
Implementation of
Cursor.Accessor. |
private static class |
AbstractCursor.ApproximateNumericAccessor
Accessor of values that are
Double or null. |
(package private) static class |
AbstractCursor.ArrayAccessor
Accessor that assumes that the underlying value is an ARRAY;
corresponds to
Types.ARRAY. |
private static class |
AbstractCursor.BigDecimalAccessor
Accessor that assumes that the underlying value is a
BigDecimal;
corresponds to Types.DECIMAL. |
private static class |
AbstractCursor.BigNumberAccessor
Accessor of exact numeric values.
|
private static class |
AbstractCursor.BinaryAccessor
Accessor that assumes that the underlying value is an array of
ByteString values;
corresponds to Types.BINARY
and Types.VARBINARY. |
private static class |
AbstractCursor.BinaryFromStringAccessor
Accessor that assumes that the underlying value is a
String,
encoding Types.BINARY
and Types.VARBINARY values in Base64 format. |
private static class |
AbstractCursor.BooleanAccessor
Accessor that assumes that the underlying value is a
Boolean;
corresponds to Types.BOOLEAN. |
private static class |
AbstractCursor.ByteAccessor
Accessor that assumes that the underlying value is a
Byte;
corresponds to Types.TINYINT. |
private static class |
AbstractCursor.DateAccessor
Accessor that assumes that the underlying value is a DATE,
represented as a java.sql.Date;
corresponds to
Types.DATE. |
private static class |
AbstractCursor.DateFromNumberAccessor
Accessor that assumes that the underlying value is a DATE,
in its default representation
int;
corresponds to Types.DATE. |
private static class |
AbstractCursor.DoubleAccessor
Accessor that assumes that the underlying value is a
Double;
corresponds to Types.DOUBLE. |
private static class |
AbstractCursor.ExactNumericAccessor
Accessor of exact numeric values.
|
private static class |
AbstractCursor.FixedStringAccessor
Accessor that assumes that the underlying value is a
String;
corresponds to Types.CHAR. |
private static class |
AbstractCursor.FloatAccessor
Accessor that assumes that the underlying value is a
Float;
corresponds to Types.FLOAT. |
protected static interface |
AbstractCursor.Getter
Gets a value from a particular field of the current record of this
cursor.
|
private static class |
AbstractCursor.IntAccessor
Accessor that assumes that the underlying value is an
Integer;
corresponds to Types.INTEGER. |
private static class |
AbstractCursor.IntervalDayTimeAccessor
Accessor that assumes that the underlying value is a
long;
corresponds to Types.OTHER. |
private static class |
AbstractCursor.IntervalYearMonthAccessor
Accessor that assumes that the underlying value is a
int;
corresponds to Types.OTHER. |
private static class |
AbstractCursor.LongAccessor
Accessor that assumes that the underlying value is a
Long;
corresponds to Types.BIGINT. |
(package private) static class |
AbstractCursor.NumberAccessor
Accessor that assumes that the underlying value is a
Number;
corresponds to Types.NUMERIC. |
private static class |
AbstractCursor.ObjectAccessor
Accessor that assumes that the underlying value is an OBJECT;
corresponds to
Types.JAVA_OBJECT. |
private static class |
AbstractCursor.ShortAccessor
Accessor that assumes that the underlying value is a
Short;
corresponds to Types.SMALLINT. |
class |
AbstractCursor.SlotGetter
Implementation of
AbstractCursor.Getter that returns the current contents of
a mutable slot. |
private static class |
AbstractCursor.StringAccessor
Accessor that assumes that the underlying value is a
String;
corresponds to Types.CHAR
and Types.VARCHAR. |
private static class |
AbstractCursor.StringFromCharAccessor
Accessor that assumes that the underlying value is a
String;
corresponds to Types.CHAR. |
private static class |
AbstractCursor.StructAccessor
Accessor that assumes that the underlying value is a STRUCT;
corresponds to
Types.STRUCT. |
class |
AbstractCursor.StructGetter
Implementation of
AbstractCursor.Getter that returns the value of a given field
of the current contents of another getter. |
private static class |
AbstractCursor.TimeAccessor
Accessor that assumes that the underlying value is a TIME,
represented as a java.sql.Time;
corresponds to
Types.TIME. |
private static class |
AbstractCursor.TimeFromNumberAccessor
Accessor that assumes that the underlying value is a Time,
in its default representation
int;
corresponds to Types.TIME. |
private static class |
AbstractCursor.TimestampAccessor
Accessor that assumes that the underlying value is a TIMESTAMP,
represented as a java.sql.Timestamp;
corresponds to
Types.TIMESTAMP. |
private static class |
AbstractCursor.TimestampFromNumberAccessor
Accessor that assumes that the underlying value is a TIMESTAMP,
in its default representation
long;
corresponds to Types.TIMESTAMP. |
private static class |
AbstractCursor.TimestampFromUtilDateAccessor
Accessor that assumes that the underlying value is a TIMESTAMP,
represented as a java.util.Date;
corresponds to
Types.TIMESTAMP. |
Cursor.Accessor| Modifier and Type | Field and Description |
|---|---|
protected boolean[] |
wasNull
Slot into which each accessor should write whether the
value returned was null.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCursor() |
| Modifier and Type | Method and Description |
|---|---|
protected Cursor.Accessor |
createAccessor(ColumnMetaData columnMetaData,
AbstractCursor.Getter getter,
Calendar localCalendar,
ArrayImpl.Factory factory) |
protected Cursor.Accessor |
createAccessor(ColumnMetaData columnMetaData,
int ordinal,
Calendar localCalendar,
ArrayImpl.Factory factory) |
List<Cursor.Accessor> |
createAccessors(List<ColumnMetaData> types,
Calendar localCalendar,
ArrayImpl.Factory factory)
Creates a list of accessors, one per column.
|
protected abstract AbstractCursor.Getter |
createGetter(int ordinal) |
private static String |
dateAsString(int v,
Calendar calendar)
Accesses a date value as a string, e.g.
|
(package private) static Time |
intToTime(int v,
Calendar calendar) |
private static Date |
longToDate(long v,
Calendar calendar) |
(package private) static Timestamp |
longToTimestamp(long v,
Calendar calendar) |
abstract boolean |
next()
Moves to the next row.
|
private static String |
timeAsString(int v,
Calendar calendar)
Accesses a time value as a string, e.g.
|
private static String |
timestampAsString(long v,
Calendar calendar)
Accesses a timestamp value as a string.
|
boolean |
wasNull()
Returns whether the last value returned was null.
|
protected final boolean[] wasNull
public boolean wasNull()
Cursorpublic List<Cursor.Accessor> createAccessors(List<ColumnMetaData> types, Calendar localCalendar, ArrayImpl.Factory factory)
CursorcreateAccessors in interface Cursortypes - List of column types, per Types.localCalendar - Calendar in local time zonefactory - Factory that creates sub-ResultSets when neededprotected Cursor.Accessor createAccessor(ColumnMetaData columnMetaData, int ordinal, Calendar localCalendar, ArrayImpl.Factory factory)
protected Cursor.Accessor createAccessor(ColumnMetaData columnMetaData, AbstractCursor.Getter getter, Calendar localCalendar, ArrayImpl.Factory factory)
protected abstract AbstractCursor.Getter createGetter(int ordinal)
public abstract boolean next()
Cursorprivate static String timestampAsString(long v, Calendar calendar)
private static String dateAsString(int v, Calendar calendar)
private static String timeAsString(int v, Calendar calendar)
Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.