|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.farrago.type.runtime.EncodedSqlDecimal
public abstract class EncodedSqlDecimal
Runtime type for decimal values. The usage of decimal values is highly restricted within the Farrago runtime. The operations allowed for decimals are:
getNullableData returns an
external data type, conforming to SQL standards.
Note: the code may be inefficient, since it relies on Java libraries for decimal support and allocates memory on a per row basis.
| Nested Class Summary | |
|---|---|
class |
EncodedSqlDecimal.AssignableDecimal
Class which assigns a value to an EncodedSqlDecimal. |
| Field Summary | |
|---|---|
static String |
ASSIGN_TO_METHOD_NAME
|
static String |
GET_PRECISION_METHOD_NAME
|
static String |
GET_SCALE_METHOD_NAME
|
private EncodedSqlDecimal.AssignableDecimal |
helper
|
private boolean |
isNull
|
static String |
NARROW_CAST_METHOD_NAME
|
private long |
overflowValue
|
static String |
REINTERPRET_METHOD_NAME
|
long |
value
|
static String |
VALUE_FIELD_NAME
|
| Fields inherited from interface net.sf.farrago.type.runtime.AssignableValue |
|---|
ASSIGNMENT_METHOD_NAME |
| Constructor Summary | |
|---|---|
EncodedSqlDecimal()
Creates a runtime object |
|
| Method Summary | |
|---|---|
void |
assignFrom(long l)
|
void |
assignFrom(Object obj)
Assigns value from an Object. |
void |
assignTo(NullablePrimitive.NullableLong target)
Assigns the internal value of this decimal to a long variable |
Object |
getNullableData()
|
protected abstract int |
getPrecision()
|
protected abstract int |
getScale()
|
boolean |
isNull()
|
void |
narrowCast(Object o)
Narrows an external BigDecimal value (potentially larger than the database can handle) into a native value. |
void |
reinterpret(long value)
Encodes a long value as an EncodedSqlDecimal without an overflow check. |
void |
reinterpret(long value,
boolean overflowCheck)
Encodes a long value as an EncodedSqlDecimal, with an optional overflow check. |
void |
reinterpret(NullablePrimitive.NullableLong primitive)
Encodes a long value as an EncodedSqlDecimal without an overflow check. |
void |
reinterpret(NullablePrimitive.NullableLong primitive,
boolean overflowCheck)
Encodes a long value as an EncodedSqlDecimal, with an optional overflow check. |
void |
setNull(boolean b)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String GET_PRECISION_METHOD_NAME
public static final String GET_SCALE_METHOD_NAME
public static final String REINTERPRET_METHOD_NAME
public static final String ASSIGN_TO_METHOD_NAME
public static final String VALUE_FIELD_NAME
public static final String NARROW_CAST_METHOD_NAME
private boolean isNull
public long value
private EncodedSqlDecimal.AssignableDecimal helper
private long overflowValue
| Constructor Detail |
|---|
public EncodedSqlDecimal()
| Method Detail |
|---|
protected abstract int getPrecision()
protected abstract int getScale()
public boolean isNull()
public void setNull(boolean b)
public void assignFrom(Object obj)
AssignableValue
assignFrom in interface AssignableValueobj - value to assign, or null to set nullpublic void assignFrom(long l)
public Object getNullableData()
getNullableData in interface DataValue
public void reinterpret(long value,
boolean overflowCheck)
value - value to be encoded as an EncodedSqlDecimaloverflowCheck - whether to check for overflowpublic void reinterpret(long value)
value - value to be encoded as an EncodedSqlDecimal
public void reinterpret(NullablePrimitive.NullableLong primitive,
boolean overflowCheck)
primitive - value to be encoded as an EncodedSqlDecimaloverflowCheck - whether to check for overflowpublic void reinterpret(NullablePrimitive.NullableLong primitive)
primitive - value to be encoded as an EncodedSqlDecimalpublic void assignTo(NullablePrimitive.NullableLong target)
target - the variable to be assignedpublic String toString()
toString in class Objectpublic void narrowCast(Object o)
o - the BigDecimal value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||