|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ims.base.DLITypeInfo
A DLITypeInfo object is used to provide the layout of a segment's fields to the base class
DLISegment. With this metadata, the DLISegment class is able to provide access to
all of the fields in any segment using either the defined field name or the 1-based index
of the DLITypeInfo object in the array that is registered for each segment type. The
defined field name can be an alias for the defined search field name in the DBD source file.
When referring to the field, you can use the field alias instead of the search or key field
name, as these field names are limited to only 8 characters. Note that the field names are
case sensitive and must be written exactly as defined in the DLITypeInfo objects. When
defining a key or search field, you must use the DLITypeInfo(String, int, int, int, String)
constructor, which allows you to provide the alias and actual name of the search or key field.
Field Summary | |
static int |
BIGINT
|
static int |
BINARY
|
static int |
BIT
|
static int |
BLOB
|
static int |
CHAR
|
static int |
CLOB
|
static int |
DATE
|
static int |
DOUBLE
|
static int |
FLOAT
|
static int |
INTEGER
|
static int |
NON_UNIQUE_KEY
|
static int |
NOT_KEY
|
static int |
PACKEDDECIMAL
|
static int |
SECONDARY_INDEX
|
static int |
SMALLINT
|
static int |
TIME
|
static int |
TIMESTAMP
|
static int |
TINYINT
|
static int |
TYPELIST
|
static int |
UNIQUE_KEY
|
static int |
VARCHAR
|
static int |
ZONEDDECIMAL
|
Constructor Summary | |
|
DLITypeInfo(java.lang.String fieldName,
int type,
int startingOffset,
int length)
Constructs a DLITypeInfo object. |
|
DLITypeInfo(java.lang.String fieldName,
int type,
int startingOffset,
int length,
java.lang.String searchFieldName)
Constructs a DLITypeInfo object. |
|
DLITypeInfo(java.lang.String fieldName,
int type,
int startingOffset,
int length,
java.lang.String searchFieldName,
int keyType)
Constructs a DLITypeInfo object, adding the ability to specify a key type. |
protected |
DLITypeInfo(java.lang.String fieldName,
int type,
java.lang.String searchFieldName,
int length)
|
|
DLITypeInfo(java.lang.String fieldName,
java.lang.String typeQualifier,
int type,
int startingOffset,
int length)
Constructs a DLITypeInfo object. |
|
DLITypeInfo(java.lang.String fieldName,
java.lang.String typeQualifier,
int type,
int startingOffset,
int length,
java.lang.String searchFieldName)
Constructs a DLITypeInfo object. |
|
DLITypeInfo(java.lang.String fieldName,
java.lang.String typeQualifier,
int type,
int startingOffset,
int length,
java.lang.String searchFieldName,
int keyType)
Constructs a DLITypeInfo object, adding the ability to specify a key type. |
Method Summary | |
int |
getFieldLength()
Returns the length of the field's value in the segment. |
java.lang.String |
getFieldName()
Returns the field name given to this field in the segment. |
int |
getFieldOffset()
Returns the offset of the field in the segment's I/O area. |
int |
getFieldType()
Returns the type assigned to a field's value in the segment. |
int |
getKeyType()
Returns the type of key the field is: DLITypeInfo.NOT_KEY DLITypeInfo.UNIQUE_KEY DLITypeInfo.NON_UNIQUE_KEY |
java.lang.String |
getSearchFieldName()
Returns the search field name given to this field in the segment, which must be exactly as defined in the DBD source file. |
java.lang.String |
getTypeQualifier()
Returns the type qualifier for this type. |
boolean |
isSigned()
Indicates whether this type is signed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TINYINT
public static final int INTEGER
public static final int CHAR
public static final int DOUBLE
public static final int FLOAT
public static final int BIT
public static final int BLOB
public static final int BIGINT
public static final int SMALLINT
public static final int VARCHAR
public static final int PACKEDDECIMAL
public static final int ZONEDDECIMAL
public static final int DATE
public static final int TIME
public static final int TIMESTAMP
public static final int TYPELIST
public static final int BINARY
public static final int SECONDARY_INDEX
public static final int CLOB
public static final int NOT_KEY
public static final int UNIQUE_KEY
public static final int NON_UNIQUE_KEY
Constructor Detail |
public DLITypeInfo(java.lang.String fieldName, int type, int startingOffset, int length)
DLITypeInfo(String, String, int, int, int)
or
DLITypeInfo(String, String, int, int, int, String)
constructors for these
types.
The DLITypeInfo
class defines several constants
that can be supplied as values for the
type
argument:
CHAR
,
INTEGER
,
DOUBLE
,
FLOAT
,
BIT
,
BLOB
,
BIGINT
,
TINYINT
,
BINARY
,
and SMALLINT
.
Certain types have predefined lengths and cannot be changed. The INTEGER
and FLOAT
types are always 4 bytes long. The DOUBLE
and BIGINT
types
are always 8 bytes long. The SMALLINT
type is always 2 bytes long. The
TINYINT
and BIT
types are always 1 byte long. If another length
value is specified for one of these types, an exception will be thrown.
fieldName
- The name of the field.type
- the type of the fieldstartingOffset
- the starting offset in the I/O area of this field, beginning at
offset 1length
- the length, in bytes, of this fieldjava.lang.IllegalArgumentException
- if the starting offset is less than zero, an
unsupported type is given, or an invalid length
is givenDLISegment
public DLITypeInfo(java.lang.String fieldName, int type, int startingOffset, int length, java.lang.String searchFieldName)
DLITypeInfo(String, String, int, int, int)
or
DLITypeInfo(String, String, int, int, int, String)
constructors for these
types. It provides functionality to provide an alias for the key and search fields. This
alias name is not limited to 8 characters.
The DLITypeInfo
class defines several constants
that can be supplied as values for the
type
argument:
CHAR
,
INTEGER
,
DOUBLE
,
FLOAT
,
BIT
,
BLOB
,
BIGINT
,
TINYINT
,
BINARY
,
and SMALLINT
.
Certain types have predefined lengths and cannot be changed. The INTEGER
and FLOAT
types are always 4 bytes long. The DOUBLE
and BIGINT
types
are always 8 bytes long. The SMALLINT
type is always 2 bytes long. The
TINYINT
and BIT
types are always 1 byte long. If another length
value is specified for one of these types, an exception will be thrown.
fieldName
- The name of the field. This name can be an alias that maps to the
the actual name as defined in the DBD source file, which is given
by the searchFieldName
parameter.type
- the type of the fieldstartingOffset
- the starting offset in the I/O area of this field, beginning at
offset 1length
- the length, in bytes, of this fieldsearchFieldName
- the name of the search or key field exactly as defined in the
DBD source filejava.lang.IllegalArgumentException
- if the starting offset is less than zero, an
unsupported type is given, or an invalid length
is givenDLISegment
public DLITypeInfo(java.lang.String fieldName, int type, int startingOffset, int length, java.lang.String searchFieldName, int keyType)
public DLITypeInfo(java.lang.String fieldName, java.lang.String typeQualifier, int type, int startingOffset, int length)
DLITypeInfo(String, String, int, int, int)
or
DLITypeInfo(String, String, int, int, int, String)
constructors for all other
types. The uses of the type qualifier are as follows:
If the field type is either packed or zoned decimal, the type qualifier is the PICTURE
string representing the layout of the field. All COBOL PICTURE strings containing valid
combinations of 9s. Ps, Vs, and Ss are supported. For zoned decimal numbers, the decimal
point (.) can also be used in the PICTURE string.
If the field contains Date/Time/Timestamp data, the type qualifier specifies the format of the
data. For example, a type qualifier of ddMMyyyy indicates that the data is formatted as
follows: 02011999 is January 2, 1999.
For DATE and TIME all formatting opions in the java.text.SimpleDateFormat class are supported.
For the TIMESTAMP type an additional formatting option 'f' has been provided for nanoseconds.
TIMESTAMP can contain up to 9 'f's and replaces the 'S' options for milliseconds; instead, 'fff'
indicates milliseconds of precision. An example TIMESTAMP format is yyyy-mm-dd hh:mm:ss.fffffffff
If the field type is a CLOB the type qualifier is the name of the child overflow segment. The child
overflow segment is used to store any overflow characters after the first length-4 characters which
will be stored in this field. This base field will only hold length-4 characters since the CLOB
field type reserves the first 4 bytes for version info and length.
The DLITypeInfo
class defines several constants
that can be supplied as values for the
type
argument:
CLOB
,
DATE
,
TIME
,
TIMESTAMP
,
ZONEDDECIMAL
and PACKEDDECIMAL
.
fieldName
- The name of the field.typeQualifier
- the type qualifier for the field, or the child overflow segment name, as described abovetype
- the type of the fieldstartingOffset
- the starting offset in the I/O area of this field, beginning at
offset 1length
- the length of the field
for a PACKEDDECIMAL number, the length can be calculated with the
following function:
ceiling((number of digits + 1)/2)
for a ZONEDDECIMAL number, the length can be calculated with the
following function:
number of digits + 1 (if the decimal is stored in memory)
number of digits (if the decimal is not stored in memory)java.lang.IllegalArgumentException
- if the starting offset is less than zero, an
unsupported type is given, or an invalid length
is givenpublic DLITypeInfo(java.lang.String fieldName, java.lang.String typeQualifier, int type, int startingOffset, int length, java.lang.String searchFieldName)
DLITypeInfo(String, String, int, int, int)
or
DLITypeInfo(String, String, int, int, int, String, int)
constructors for all other
types. This constructor provides functionality to provide an alias for the key and search
fields. This alias name is not limited to 8 characters. The uses of the type qualifier
are as follows:
If the field type is either packed or zoned decimal, the type qualifier is the PICTURE
string representing the layout of the field. All COBOL PICTURE strings containing valid
combinations of 9s. Ps, Vs, and Ss are supported. For zoned decimal numbers, the decimal
point (.) can also be used in the PICTURE string.
If the field contains Date/Time/Timestamp data, the type qualifier specifies the format of the
data. For example, a type qualifier of ddMMyyyy indicates that the data is formatted as
follows: 02011999 is January 2, 1999.
For DATE and TIME all formatting opions in the java.text.SimpleDateFormat class are supported.
For the TIMESTAMP type an additional formatting option 'f' has been provided for nanoseconds.
TIMESTAMP can contain up to 9 'f's and replaces the 'S' options for milliseconds; instead, 'fff'
indicates milliseconds of precision. An example TIMESTAMP format is yyyy-mm-dd hh:mm:ss.fffffffff
If the field type is a CLOB the type qualifier is the name of the child overflow segment. The child
overflow segment is used to store any overflow characters after the first length-4 characters which
will be stored in this field. This base field will only hold length-4 characters since the CLOB
field type reserves the first 4 bytes for version info and length.
The DLITypeInfo
class defines several constants
that can be supplied as values for the
type
argument:
CLOB
,
DATE
,
TIME
,
TIMESTAMP
,
ZONEDDECIMAL
and PACKEDDECIMAL
.
fieldName
- The name of the field. This name can be an alias that maps to the
the actual name as defined in the DBD source file, which is given
by the searchFieldName
parameter.typeQualifier
- the type qualifier for the fieldtype
- the type of the fieldstartingOffset
- the starting offset in the I/O area of this field, beginning at
offset 1length
- the length of the fieldsearchFieldName
- the name of the search or key field exactly as defined in the
DBD source filejava.lang.IllegalArgumentException
- if the starting offset is less than zero, an
unsupported type is given, or an invalid length
is givenpublic DLITypeInfo(java.lang.String fieldName, java.lang.String typeQualifier, int type, int startingOffset, int length, java.lang.String searchFieldName, int keyType)
protected DLITypeInfo(java.lang.String fieldName, int type, java.lang.String searchFieldName, int length)
Method Detail |
public int getFieldLength()
public java.lang.String getFieldName()
public int getFieldOffset()
public int getFieldType()
public int getKeyType()
public java.lang.String getSearchFieldName()
public java.lang.String getTypeQualifier()
public boolean isSigned()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |