Package org.apache.calcite.avatica.util
Class AbstractCursor.NumberAccessor
- java.lang.Object
-
- org.apache.calcite.avatica.util.AbstractCursor.AccessorImpl
-
- org.apache.calcite.avatica.util.AbstractCursor.BigNumberAccessor
-
- org.apache.calcite.avatica.util.AbstractCursor.NumberAccessor
-
- All Implemented Interfaces:
Cursor.Accessor
- Direct Known Subclasses:
AbstractCursor.DateFromNumberAccessor,AbstractCursor.TimeFromNumberAccessor,AbstractCursor.TimestampFromNumberAccessor
- Enclosing class:
- AbstractCursor
static class AbstractCursor.NumberAccessor extends AbstractCursor.BigNumberAccessor
Accessor that assumes that the underlying value is aNumber; corresponds toTypes.NUMERIC.This is useful when numbers have been translated over JSON. JSON converts a 0L (0 long) value to the string "0" and back to 0 (0 int). So you cannot be sure that the source and target type are the same.
-
-
Field Summary
Fields Modifier and Type Field Description private intscale-
Fields inherited from class org.apache.calcite.avatica.util.AbstractCursor.AccessorImpl
getter
-
-
Constructor Summary
Constructors Constructor Description NumberAccessor(AbstractCursor.Getter getter, int scale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalgetBigDecimal()java.math.BigDecimalgetBigDecimal(int scale)protected java.lang.NumbergetNumber()-
Methods inherited from class org.apache.calcite.avatica.util.AbstractCursor.BigNumberAccessor
getBoolean, getByte, getDouble, getFloat, getInt, getLong, getShort
-
Methods inherited from class org.apache.calcite.avatica.util.AbstractCursor.AccessorImpl
getArray, getAsciiStream, getBinaryStream, getBlob, getBytes, getCharacterStream, getClob, getDate, getNCharacterStream, getNClob, getNString, getObject, getObject, getObject, getRef, getSQLXML, getString, getStruct, getTime, getTimestamp, getUnicodeStream, getURL, wasNull
-
-
-
-
Constructor Detail
-
NumberAccessor
NumberAccessor(AbstractCursor.Getter getter, int scale)
-
-
Method Detail
-
getNumber
protected java.lang.Number getNumber() throws java.sql.SQLException- Specified by:
getNumberin classAbstractCursor.BigNumberAccessor- Throws:
java.sql.SQLException
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(int scale) throws java.sql.SQLException- Specified by:
getBigDecimalin interfaceCursor.Accessor- Overrides:
getBigDecimalin classAbstractCursor.AccessorImpl- Throws:
java.sql.SQLException
-
getBigDecimal
public java.math.BigDecimal getBigDecimal() throws java.sql.SQLException- Specified by:
getBigDecimalin interfaceCursor.Accessor- Overrides:
getBigDecimalin classAbstractCursor.AccessorImpl- Throws:
java.sql.SQLException
-
-