|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.jzos.fields.DatatypeFactory
public abstract class DatatypeFactory
An abstract class for classes which are used to construct Field
objects. A running offset to the next field is maintained, along with a
stack which can be used to push and pop the current Field offset.
A DatatypeFactory is typically used to statically initialize static
Field variables in a Java class which maps a record described by a byte array.
For an example, see Format1DSCB.
| Field Summary | |
|---|---|
protected int |
maximumOffset
|
protected int |
offset
|
protected java.lang.String |
stringEncoding
|
protected boolean |
stringTrimDefault
|
| Constructor Summary | |
|---|---|
DatatypeFactory()
|
|
| Method Summary | |
|---|---|
protected void |
advanceOffset(Field field)
Increments the current Field offset by the length a Field |
ByteArrayField |
getByteArrayField(int length)
Construct and return a ByteArrayField, advancing the current offset by its byte length. |
ExternalDecimalAsBigDecimalField |
getExternalDecimalAsBigDecimalField(int precision,
int scale,
boolean signed)
Construct and return a ExternalDecimalAsBigDecimalField, advancing the current offset by its byte length. |
ExternalDecimalAsBigDecimalField |
getExternalDecimalAsBigDecimalField(int precision,
int scale,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
Construct and return a ExternalDecimalAsBigDecimalField, advancing the current offset by its byte length. |
ExternalDecimalAsBigIntegerField |
getExternalDecimalAsBigIntegerField(int precision,
boolean signed)
Construct and return a ExternalDecimalAsBigIntegerField, advancing the current offset by its byte length. |
ExternalDecimalAsBigIntegerField |
getExternalDecimalAsBigIntegerField(int precision,
int scale,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
Construct and return a ExternalDecimalAsBigIntegerField, advancing the current offset by its byte length. |
ExternalDecimalAsIntField |
getExternalDecimalAsIntField(int precision,
boolean signed)
Construct and return a ExternalDecimalAsIntField, advancing the current offset by its byte length. |
ExternalDecimalAsIntField |
getExternalDecimalAsIntField(int precision,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
Construct and return a ExternalDecimalAsIntField, advancing the current offset by its byte length. |
ExternalDecimalAsLongField |
getExternalDecimalAsLongField(int precision,
boolean signed)
Construct and return a ExternalDecimalAsLongField, advancing the current offset by its byte length. |
ExternalDecimalAsLongField |
getExternalDecimalAsLongField(int precision,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
Construct and return a ExternalDecimalAsLongField, advancing the current offset by its byte length. |
int |
getMaximumOffset()
Answer the maximum value of the offset |
int |
getOffset()
Answer the current (next) Field offset |
java.lang.String |
getStringEncoding()
Gets the current String encoding used for construction of StringFields. |
StringField |
getStringField(int length)
Construct and return a StringField, advancing the current offset by its byte length. |
StringField |
getStringField(int length,
boolean trim)
Construct and return a StringField, advancing the current offset by its byte length. |
StringField |
getStringField(int length,
boolean trim,
boolean padLeft)
Construct and return a StringField, advancing the current offset by its byte length. |
StringField |
getStringField(int length,
boolean trim,
boolean padLeft,
boolean allowTruncation)
Construct and return a StringField, advancing the current offset by its byte length. |
StringField |
getStringField(int length,
boolean trim,
boolean padLeft,
boolean allowTruncation,
java.lang.String encoding)
Construct and return a StringField, advancing the current offset by its byte length. |
boolean |
getStringTrimDefault()
Answer the default setting for StringField trimming if not explicitly given. |
void |
incrementOffset(int amount)
Increments the current Field offset |
void |
popOffset()
Pop the Field offset from the top of an internal stack. |
void |
pushOffset()
Push the current Field offset onto an internal stack. |
void |
setOffset(int offset)
|
void |
setStringEncoding(java.lang.String stringEncoding)
|
void |
setStringTrimDefault(boolean value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int offset
protected int maximumOffset
protected java.lang.String stringEncoding
protected boolean stringTrimDefault
| Constructor Detail |
|---|
public DatatypeFactory()
| Method Detail |
|---|
public int getOffset()
public int getMaximumOffset()
public void setOffset(int offset)
getOffset()public void pushOffset()
popOffset()public void popOffset()
pushOffset()public void incrementOffset(int amount)
amount - intprotected void advanceOffset(Field field)
field - Fieldpublic java.lang.String getStringEncoding()
StringField.getEncoding()public boolean getStringTrimDefault()
public void setStringTrimDefault(boolean value)
getStringTrimDefault()public void setStringEncoding(java.lang.String stringEncoding)
getStringEncoding()
public ExternalDecimalAsBigDecimalField getExternalDecimalAsBigDecimalField(int precision,
int scale,
boolean signed)
precision - the number of decimal digits of precisionscale - the number of implied decimal digits to the right of the decimal pointsigned - boolean true if the value is signed
ExternalDecimalAsBigDecimalField.ExternalDecimalAsBigDecimalField(int, int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsBigDecimalField getExternalDecimalAsBigDecimalField(int precision,
int scale,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
precision - the number of decimal digits of precisionscale - the number of implied decimal digits to the right of the decimal pointsigned - boolean true if the value is signedsignTrailing - true if the sign is stored at the end of the fieldsignExternal - true if the sign is stored in a separate byteblankWhenZero - true if the field is all spaces when zero
ExternalDecimalAsBigDecimalField.ExternalDecimalAsBigDecimalField(int, int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsBigIntegerField getExternalDecimalAsBigIntegerField(int precision,
boolean signed)
precision - the number of decimal digits of precisionsigned - boolean true if the value is signed
ExternalDecimalAsBigIntegerField.ExternalDecimalAsBigIntegerField(int, int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsBigIntegerField getExternalDecimalAsBigIntegerField(int precision,
int scale,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
precision - the number of decimal digits of precisionscale - the number of implied decimal digits to the right of the decimal pointsigned - boolean true if the value is signedsignTrailing - true if the sign is stored at the end of the fieldsignExternal - true if the sign is stored in a separate byteblankWhenZero - true if the field is all spaces when zero
ExternalDecimalAsBigIntegerField.ExternalDecimalAsBigIntegerField(int, int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsIntField getExternalDecimalAsIntField(int precision,
boolean signed)
precision - the number of decimal digits of precisionsigned - boolean true if the value is signed
ExternalDecimalAsIntField.ExternalDecimalAsIntField(int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsIntField getExternalDecimalAsIntField(int precision,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
precision - the number of decimal digits of precisionsigned - boolean true if the value is signedsignTrailing - true if the sign is stored at the end of the fieldsignExternal - true if the sign is stored in a separate byteblankWhenZero - true if the field is all spaces when zero
ExternalDecimalAsIntField.ExternalDecimalAsIntField(int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsLongField getExternalDecimalAsLongField(int precision,
boolean signed)
precision - the number of decimal digits of precisionsigned - boolean true if the value is signed
ExternalDecimalAsLongField.ExternalDecimalAsLongField(int, int, boolean, boolean, boolean, boolean)
public ExternalDecimalAsLongField getExternalDecimalAsLongField(int precision,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
precision - the number of decimal digits of precisionsigned - boolean true if the value is signedsignTrailing - true if the sign is stored at the end of the fieldsignExternal - true if the sign is stored in a separate byteblankWhenZero - true if the field is all spaces when zero
ExternalDecimalAsLongField.ExternalDecimalAsLongField(int, int, boolean, boolean, boolean, boolean)public ByteArrayField getByteArrayField(int length)
length - the size of the field in bytes
ByteArrayField.ByteArrayField(int, int)public StringField getStringField(int length)
length - the length of the field in bytes.
public StringField getStringField(int length,
boolean trim)
length - trim -
StringField.StringField(int, int, boolean)
public StringField getStringField(int length,
boolean trim,
boolean padLeft,
boolean allowTruncation,
java.lang.String encoding)
length - the length of the field in bytes.trim - true if the String returned from the underlying byte array is to be trimmed of
leading (padLeft == true) or trailing (padLeft == false) blanks.padLeft - true if small values are to be left padded with blanksallowTruncation - true if large Strings are to be right truncated. If false an
IllegalArgumentException will be thrown.encoding - the character set encoding. This is assumed to be an EBCDIC variant.
public StringField getStringField(int length,
boolean trim,
boolean padLeft,
boolean allowTruncation)
length - the length of the field in bytes.trim - true if the String returned from the underlying byte array is to be trimmed of
leading (padLeft == true) or trailing (padLeft == false) blanks.padLeft - true if small values are to be left padded with blanksallowTruncation - true if large Strings are to be right truncated. If false an
IllegalArgumentException will be thrown.
public StringField getStringField(int length,
boolean trim,
boolean padLeft)
length - the length of the field in bytes.trim - true if the String returned from the underlying byte array is to be trimmed of
leading (padLeft == true) or trailing (padLeft == false) blanks.padLeft - true if small values are to be left padded with blanks
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||