|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.knaw.dans.common.dbflib.Value
public abstract class Value
Represents a value that can be stored in a record. Value
s can be created by
instantiating sub-classes of this type. These subclasses are by convention called according to
the Java type they store, e.g., a BooleanValue
stores a Java Boolean
.
This interface has methods to retrieve the wrapped value in two formats: as an object of the Java
type that the concrete subclass refers to (e.g., Boolean.TRUE
) or as the raw bytes
that are stored in the DBF file (e.g., {(byte)'Y'}
). The raw value may depend on the
exact specifications (length, decimal count) of the field that is read from or written to. That
is why a Field
instance must be specified when retrieving it.
Field Summary | |
---|---|
protected Object |
typed
|
Constructor Summary | |
---|---|
protected |
Value(Field originalField,
byte[] rawValue)
Constructs a Value object with the specified raw value. |
protected |
Value(Object aTypedValue)
Constructs a Value object with the specified typed value, i.e. |
Method Summary | |
---|---|
protected abstract byte[] |
doGetRawValue(Field aField)
Converts the typed value to a byte array, according to the field specifications provided. |
protected abstract Object |
doGetTypedValue(byte[] rawValue)
Converts the raw bytes to a Java object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Object typed
Constructor Detail |
---|
protected Value(Field originalField, byte[] rawValue)
doGetTypedValue(byte[])
.
rawValue
- the bytes that constitute the raw valueprotected Value(Object aTypedValue)
doGetRawValue(nl.knaw.dans.common.dbflib.Field)
.
aTypedValue
- the value as a Java objectMethod Detail |
---|
protected abstract Object doGetTypedValue(byte[] rawValue)
protected abstract byte[] doGetRawValue(Field aField) throws ValueTooLargeException
aField
- the field specifications
ValueTooLargeException
- if the value is too large for the
field
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |