|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.jtopenlite.ddm.DDMField
public final class DDMField
Represents an individual field of a record format.
| Field Summary | |
|---|---|
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
|
| Method Summary | |
|---|---|
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,
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. |
String |
getDateTimeFormat()
Returns the date/time format (WHFMT) of this field. |
String |
getDateTimeSeparator()
Returns the date/time separator (WHSEP) of this field. |
int |
getDecimalPositions()
Returns the number of decimal positions (WHFLDP) of this field. |
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. |
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. |
String |
getString(byte[] recordData)
Converts the specified record data at this field's offset directly into a String value, if possible. |
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(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(String value,
byte[] recordData)
Converts the specified String value into record data for this field's type at this field's offset, if possible. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Method Detail |
|---|
public DDMField newCopy()
public String getName()
public char getType()
public int getLength()
public int getOffset()
public String getText()
public int getCCSID()
public String getDefaultValue()
public boolean isVariableLength()
public boolean isNullAllowed()
public int getAllocatedLength()
public int getNumberOfDigits()
public int getDecimalPositions()
public String getDateTimeFormat()
public 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 IOException
IOException
public short getShort(byte[] recordData)
throws IOException
IOException
public int getInt(byte[] recordData)
throws IOException
IOException
public byte getByte(byte[] recordData)
throws IOException
IOException
public byte[] getBytes(byte[] recordData)
throws IOException
IOException
public void setBytes(byte[] value,
byte[] recordData)
throws IOException
IOException
public float getFloat(byte[] recordData)
throws IOException
IOException
public double getDouble(byte[] recordData)
throws IOException
IOException
public String getString(byte[] recordData)
throws IOException
IOException
public boolean getDate(byte[] recordData,
Calendar cal)
throws IOException
IOException
public void setDate(Calendar cal,
byte[] recordData)
throws IOException
IOException
public void setString(String value,
byte[] recordData)
throws IOException
IOException
public void setDouble(double value,
byte[] recordData)
throws IOException
IOException
public void setFloat(float value,
byte[] recordData)
throws IOException
IOException
public void setByte(byte value,
byte[] recordData)
throws IOException
IOException
public void setShort(short value,
byte[] recordData)
throws IOException
IOException
public void setInt(int value,
byte[] recordData)
throws IOException
IOException
public void setLong(long value,
byte[] recordData)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||