com.ibm.ims.base
Class DLITypeInfoList

java.lang.Object
  |
  +--com.ibm.ims.base.DLITypeInfo
        |
        +--com.ibm.ims.base.DLITypeInfoList
All Implemented Interfaces:
java.io.Serializable

public class DLITypeInfoList
extends DLITypeInfo

A DLITypeInfoList object is a specialization of a DLITypeInfo object that defines a set of fields that occur more than once. You construct a DLITypeInfoList object by providing the offset and entire length of the fields that repeat, as well as a count of the number of occurrences of the repeating fields. The following example demonstrates how to define a ModelOutput message containing a variable number of entries for Make, Model, and Color. The total message will be 6004 bytes long and can contain a maximum of 100 60 byte entries of Make, Model, and Color.

   public class ModelOutput extends IMSFieldMessage {

     static DLITypeInfo[] modelTypeInfo = {
           new DLITypeInfo("Make",   DLITypeInfo.CHAR,       1,  20),
           new DLITypeInfo("Model",  DLITypeInfo.CHAR,      21,  20),
           new DLITypeInfo("Color",  DLITypeInfo.CHAR,      41,  20)
     };

     static DLITypeInfo[] modelOutputTypeInfo = {
        new DLITypeInfo     ("ModelCount", DLITypeInfo.INTEGER,  1,  4),
        new DLITypeInfoList ("ModelList",  modelTypeInfo,        5, 60, 100)
     };

     public ModelOutput() {
        super(modelOutputTypeInfo, 6004, false);
     }
   }




 

See Also:
Serialized Form

Fields inherited from class com.ibm.ims.base.DLITypeInfo
BIGINT, BINARY, BIT, BLOB, CHAR, CLOB, DATE, DOUBLE, FLOAT, INTEGER, NON_UNIQUE_KEY, NOT_KEY, PACKEDDECIMAL, SECONDARY_INDEX, SMALLINT, TIME, TIMESTAMP, TINYINT, TYPELIST, UNIQUE_KEY, VARCHAR, ZONEDDECIMAL
 
Constructor Summary
DLITypeInfoList(java.lang.String listName, DLITypeInfo[] typeInfo, int startingOffset, int length, int count)
          Constructs a DLITypeInfoList object.
 
Method Summary
 int getCount()
          Returns the count of repeating fields.
 
Methods inherited from class com.ibm.ims.base.DLITypeInfo
getFieldLength, getFieldName, getFieldOffset, getFieldType, getKeyType, getSearchFieldName, getTypeQualifier, isSigned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DLITypeInfoList

public DLITypeInfoList(java.lang.String listName,
                       DLITypeInfo[] typeInfo,
                       int startingOffset,
                       int length,
                       int count)
Constructs a DLITypeInfoList object.
Parameters:
listName - the name of the repeating set of fields
startingOffset - the starting offset in the I/O area of this set of fields, beginning at offset 1
length - the length, in bytes, of one instance of this set of fields
count - the number of times the fields repeat
Throws:
java.lang.IllegalArgumentException - if the starting offset is less than zero, or an invalid length is given
Method Detail

getCount

public final int getCount()
Returns the count of repeating fields.
Returns:
int the count


(C) International Business Machines Corporation 2004. All rights reserved.