public final class DDMField
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char |
TYPE_BINARY |
static char |
TYPE_BINARY_CHARACTER |
static char |
TYPE_CHARACTER |
static char |
TYPE_DATE |
static char |
TYPE_DBCS_EITHER |
static char |
TYPE_DBCS_GRAPHIC |
static char |
TYPE_DBCS_ONLY |
static char |
TYPE_DBCS_OPEN |
static char |
TYPE_DECIMAL_FLOAT |
static char |
TYPE_FLOAT |
static char |
TYPE_HEXADECIMAL |
static char |
TYPE_PACKED_DECIMAL |
static char |
TYPE_TIME |
static char |
TYPE_TIMESTAMP |
static char |
TYPE_ZONED_DECIMAL |
Modifier and Type | Method and Description |
---|---|
int |
getAllocatedLength()
Returns the database allocated length (WHALLC) of this field.
|
byte |
getByte(byte[] recordData)
Converts the specified record data at this field's offset into a byte value, if possible.
|
byte[] |
getBytes(byte[] recordData)
Returns an array of bytes that is only this field's data, which is a subset of the specified record data.
|
int |
getCCSID()
Returns the CCSID (WHCCSID) of this field.
|
boolean |
getDate(byte[] recordData,
java.util.Calendar cal)
Converts the specified record data at this field's offset into a date, time, or timestamp, if possible,
and sets the appropriate fields in the provided Calendar object.
|
java.lang.String |
getDateTimeFormat()
Returns the date/time format (WHFMT) of this field.
|
java.lang.String |
getDateTimeSeparator()
Returns the date/time separator (WHSEP) of this field.
|
int |
getDecimalPositions()
Returns the number of decimal positions (WHFLDP) of this field.
|
java.lang.String |
getDefaultValue()
Returns the default value (WHDFT) of this field.
|
double |
getDouble(byte[] recordData)
Converts the specified record data at this field's offset into a double value, if possible.
|
float |
getFloat(byte[] recordData)
Converts the specified record data at this field's offset into a float value, if possible.
|
int |
getInt(byte[] recordData)
Converts the specified record data at this field's offset into an int value, if possible.
|
int |
getLength()
Returns the length (WHFLDB) of this field.
|
long |
getLong(byte[] recordData)
Converts the specified record data at this field's offset into a long value, if possible.
|
java.lang.String |
getName()
Returns the name (WHFLDE) of this field.
|
int |
getNumberOfDigits()
Returns the total number of digits (WHFLDO) of this field.
|
int |
getOffset()
Returns the offset in the record data where this field begins.
|
short |
getShort(byte[] recordData)
Converts the specified record data at this field's offset into a short value, if possible.
|
java.lang.String |
getString(byte[] recordData)
Converts the specified record data at this field's offset directly into a String value, if possible.
|
java.lang.String |
getText()
Returns the text description (WHFTXT) of this field.
|
char |
getType()
Returns the type (WHFLDT) of this field.
|
boolean |
isCacheStrings()
Indicates if
getString() will cache previously created String values
for memory conservation. |
boolean |
isNullAllowed()
Indicates if this field allows null values (WHNULL).
|
boolean |
isVariableLength()
Indicates if this field is variable length (WHVARL).
|
DDMField |
newCopy()
Returns a new copy of this field, which is useful if multiple threads
need to operate on the same field without contention, as this class
is not threadsafe.
|
void |
setByte(byte value,
byte[] recordData)
Converts the specified byte value into record data for this field's type at this field's offset, if possible.
|
void |
setBytes(byte[] value,
byte[] recordData)
Converts the specified byte array value into record data at this field's offset, if possible.
|
void |
setCacheStrings(boolean useCache)
Enables or disables string caching for this field.
|
void |
setDate(java.util.Calendar cal,
byte[] recordData)
Converts the specified Calendar value into record data for this field's type at this field's offset, if possible.
|
void |
setDouble(double value,
byte[] recordData)
Converts the specified double value into record data for this field's type at this field's offset, if possible.
|
void |
setFloat(float value,
byte[] recordData)
Converts the specified float value into record data for this field's type at this field's offset, if possible.
|
void |
setInt(int value,
byte[] recordData)
Converts the specified int value into record data for this field's type at this field's offset, if possible.
|
void |
setLong(long value,
byte[] recordData)
Converts the specified long value into record data for this field's type at this field's offset, if possible.
|
void |
setShort(short value,
byte[] recordData)
Converts the specified short value into record data for this field's type at this field's offset, if possible.
|
void |
setString(java.lang.String value,
byte[] recordData)
Converts the specified String value into record data for this field's type at this field's offset, if possible.
|
public static final char TYPE_CHARACTER
public static final char TYPE_DBCS_EITHER
public static final char TYPE_DBCS_GRAPHIC
public static final char TYPE_DBCS_ONLY
public static final char TYPE_DBCS_OPEN
public static final char TYPE_BINARY
public static final char TYPE_FLOAT
public static final char TYPE_DECIMAL_FLOAT
public static final char TYPE_HEXADECIMAL
public static final char TYPE_BINARY_CHARACTER
public static final char TYPE_DATE
public static final char TYPE_PACKED_DECIMAL
public static final char TYPE_ZONED_DECIMAL
public static final char TYPE_TIME
public static final char TYPE_TIMESTAMP
public DDMField newCopy()
public java.lang.String getName()
public char getType()
public int getLength()
public int getOffset()
public java.lang.String getText()
public int getCCSID()
public java.lang.String getDefaultValue()
public boolean isVariableLength()
public boolean isNullAllowed()
public int getAllocatedLength()
public int getNumberOfDigits()
public int getDecimalPositions()
public java.lang.String getDateTimeFormat()
public java.lang.String getDateTimeSeparator()
public boolean isCacheStrings()
getString()
will cache previously created String values
for memory conservation. This can be extremely helpful for fields that contain a finite
number of distinct values across all the records in the file.setCacheStrings(boolean)
public void setCacheStrings(boolean useCache)
getString()
will cache previously created String values for the purposes of conserving memory. This can
be extremely helpful for fields that contain a finite number of distinct values across
all the records in the file.public long getLong(byte[] recordData) throws java.io.IOException
java.io.IOException
public short getShort(byte[] recordData) throws java.io.IOException
java.io.IOException
public int getInt(byte[] recordData) throws java.io.IOException
java.io.IOException
public byte getByte(byte[] recordData) throws java.io.IOException
java.io.IOException
public byte[] getBytes(byte[] recordData) throws java.io.IOException
java.io.IOException
public void setBytes(byte[] value, byte[] recordData) throws java.io.IOException
java.io.IOException
public float getFloat(byte[] recordData) throws java.io.IOException
java.io.IOException
public double getDouble(byte[] recordData) throws java.io.IOException
java.io.IOException
public java.lang.String getString(byte[] recordData) throws java.io.IOException
java.io.IOException
public boolean getDate(byte[] recordData, java.util.Calendar cal) throws java.io.IOException
java.io.IOException
public void setDate(java.util.Calendar cal, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setString(java.lang.String value, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setDouble(double value, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setFloat(float value, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setByte(byte value, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setShort(short value, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setInt(int value, byte[] recordData) throws java.io.IOException
java.io.IOException
public void setLong(long value, byte[] recordData) throws java.io.IOException
java.io.IOException