|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ims.base.DLIBaseSegment
DLIBaseSegment is the abstract base class for objects representing segments in a DL/I database. These DLIBaseSegment subclasses provide the mapping between the data in the segment and access functions on the class. To provide the mapping, the subclasses must register their DLITypeInfo with this class by providing it as the argument to the constructor. By doing so, the DLIBaseSegment class knows the layout of each segment in the database and can access as well as update each of the fields within a segment.
Field Summary | |
protected byte[] |
ioArea
|
protected int |
ioAreaLength
|
protected int |
ioAreaOffset
|
Constructor Summary | |
protected |
DLIBaseSegment(java.lang.String segmentName,
DLITypeInfo[] typeInfo,
int length)
|
Method Summary | |
protected void |
clearWarnings()
Insert the method's description here. |
java.lang.Object |
clone()
Creates a new object of the same class as this object. |
java.math.BigDecimal |
getBigDecimal(int index)
Returns the field indicated by the index as a BigDecimal. |
java.math.BigDecimal |
getBigDecimal(int index,
int scale)
Returns the field indicated by the index as a BigDecimal. |
java.math.BigDecimal |
getBigDecimal(java.lang.String fieldName)
Returns the field specified by the parameter as a BigDecimal. |
java.math.BigDecimal |
getBigDecimal(java.lang.String fieldName,
int scale)
Returns the field specified by the parameter as a BigDecimal. |
boolean |
getBoolean(int index)
Returns the field indicated by the index as a boolean. |
boolean |
getBoolean(java.lang.String fieldName)
Returns the field specified by the parameter as a boolean. |
byte |
getByte(int index)
Returns the field indicated by the index as a byte. |
byte |
getByte(java.lang.String fieldName)
Returns the field specified by the parameter as a byte. |
byte[] |
getBytes()
Return the raw byte array that represents this segment. |
byte[] |
getBytes(int index)
Returns the field indicated by the index "as is" (ie; the raw bytes of the field). |
byte[] |
getBytes(java.lang.String fieldName)
Returns the field specified by the parameter "as is" (ie; the raw bytes of the field). |
java.sql.Date |
getDate(int index)
Returns the field indicated by the index as a java.sql.Date object. |
java.sql.Date |
getDate(java.lang.String fieldName)
Returns the field specified by the parameter as a java.sql.Date object. |
java.lang.String |
getDefaultEncoding()
Returns the default character encoding for this segment. |
double |
getDouble(int index)
Returns the field indicated by the index as a double. |
double |
getDouble(java.lang.String fieldName)
Returns the field specified by the parameter as a double. |
float |
getFloat(int index)
Returns the field indicated by the index as a float. |
float |
getFloat(java.lang.String fieldName)
Returns the field specified by the parameter as a float. |
int |
getInt(int index)
Returns the field indicated by the index as an int. |
int |
getInt(java.lang.String fieldName)
Returns the field specified by the parameter as an int. |
long |
getLong(int index)
Returns the field indicated by the index as a long. |
long |
getLong(java.lang.String fieldName)
Returns the field specified by the parameter as a long. |
int |
getOffset()
Returns the offset of the IO Area |
java.lang.String |
getSegmentName()
Returns the name of the segment as stored in the database. |
short |
getShort(int index)
Returns the field indicated by the index as a short. |
short |
getShort(java.lang.String fieldName)
Returns the field specified by the parameter as a short. |
java.lang.String |
getString(int index)
Returns the field indicated by the index as a String. |
java.lang.String |
getString(java.lang.String fieldName)
Returns the field specified by the parameter as a String. |
java.sql.Time |
getTime(int index)
Returns the field indicated by the index as a java.sql.Time object. |
java.sql.Time |
getTime(java.lang.String fieldName)
Returns the field specified by the parameter as a java.sql.Time object. |
java.sql.Timestamp |
getTimestamp(int index)
Returns the field indicated by the index as a java.sql.Timestamp object. |
java.sql.Timestamp |
getTimestamp(java.lang.String fieldName)
Returns the field specified by the parameter as a java.sql.Timestamp object. |
DLITypeInfo[] |
getTypeInfo()
Returns an array of the DLITypeInfo instances for this segment. |
DLITypeInfo |
getTypeInfo(int index)
Returns the DLITypeInfo of the field specified by the index parameter. |
DLITypeInfo |
getTypeInfo(java.lang.String fieldName)
Returns the DLITypeInfo of the field specified by the fieldName parameter. |
protected DLIWarning |
getWarnings()
Insert the method's description here. |
void |
setBigDecimal(int index,
java.math.BigDecimal value)
Sets the field indicated by the index to the specified BigDecimal value. |
void |
setBigDecimal(java.lang.String fieldName,
java.math.BigDecimal value)
Sets the field indicated by the fieldName parameter to the specified BigDecimal value. |
void |
setBoolean(int index,
boolean value)
Sets the field indicated by the index to the specified boolean value. |
void |
setBoolean(java.lang.String fieldName,
boolean value)
Sets the field indicated by the fieldName parameter to the specified boolean value. |
void |
setByte(int index,
byte value)
Sets the field indicated by the index to the specified byte value. |
void |
setByte(java.lang.String fieldName,
byte value)
Sets the field indicated by the fieldName parameter to the specified byte value. |
protected void |
setBytes(byte[] value)
Sets the field indicated by the index to the exact bytes passed in the array, with no conversion. |
void |
setBytes(int index,
byte[] value)
Sets the field indicated by the index to the exact bytes passed in the array, with no conversion. |
void |
setBytes(java.lang.String fieldName,
byte[] value)
Sets the field indicated by the fieldName parameter to the exact bytes passed in the array, with no conversion. |
void |
setDate(int index,
java.sql.Date value)
Sets the field indicated by the index to the specified Date value. |
void |
setDate(java.lang.String fieldName,
java.sql.Date value)
Sets the field indicated by the fieldName parameter to the specified Date value. |
void |
setDefaultEncoding(java.lang.String encoding)
Sets the character encoding that all character data in the segment adheres to. |
void |
setDouble(int index,
double value)
Sets the field indicated by the index to the specified double value. |
void |
setDouble(java.lang.String fieldName,
double value)
Sets the field indicated by the fieldName parameter to the specified double value. |
void |
setFloat(int index,
float value)
Sets the field indicated by the index to the specified float value. |
void |
setFloat(java.lang.String fieldName,
float value)
Sets the field indicated by the index to the specified float value. |
void |
setInt(int index,
int value)
Sets the field indicated by the index to the specified int value. |
void |
setInt(java.lang.String fieldName,
int value)
Sets the field indicated by the fieldName parameter to the specified int value. |
void |
setLong(int index,
long value)
Sets the field indicated by the index to the specified long value. |
void |
setLong(java.lang.String fieldName,
long value)
Sets the field indicated by the fieldName parameter to the specified long value. |
void |
setShort(int index,
short value)
Sets the field indicated by the index to the specified short value. |
void |
setShort(java.lang.String fieldName,
short value)
Sets the field indicated by the fieldName parameter to the specified short value. |
void |
setString(int index,
java.lang.String value)
Sets the field indicated by the index to the specified String value. |
void |
setString(java.lang.String fieldName,
java.lang.String value)
Sets the field indicated by the fieldName parameter to the specified String value. |
void |
setTime(int index,
java.sql.Time value)
Sets the field indicated by the index to the specified Time value. |
void |
setTime(java.lang.String fieldName,
java.sql.Time value)
Sets the field indicated by the fieldName parameter to the specified Time value. |
void |
setTimestamp(int index,
java.sql.Timestamp value)
Sets the field indicated by the index to the specified Timestamp value. |
void |
setTimestamp(java.lang.String fieldName,
java.sql.Timestamp value)
Sets the field indicated by the fieldName parameter to the specified Timestamp value. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected byte[] ioArea
protected int ioAreaOffset
protected int ioAreaLength
Constructor Detail |
protected DLIBaseSegment(java.lang.String segmentName, DLITypeInfo[] typeInfo, int length)
Method Detail |
protected void clearWarnings()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.math.BigDecimal getBigDecimal(int index) throws DLIException
index
- the one-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic java.math.BigDecimal getBigDecimal(int index, int scale) throws DLIException
index
- the one-based index of the desired field in the DLITypeInfo arrayscale
- the number of digits to the right of the decimalDLIException
- if the conversion cannot be donepublic java.math.BigDecimal getBigDecimal(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic java.math.BigDecimal getBigDecimal(java.lang.String fieldName, int scale) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayscale
- the number of digits to the right of the decimalDLIException
- if the field name is not found in the segmentpublic boolean getBoolean(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic boolean getBoolean(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic byte getByte(int index) throws DLIException
index
- the one-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic byte getByte(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic byte[] getBytes()
public byte[] getBytes(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic byte[] getBytes(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic java.sql.Date getDate(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic java.sql.Date getDate(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic java.lang.String getDefaultEncoding()
public double getDouble(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic double getDouble(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic float getFloat(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic float getFloat(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic int getInt(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic int getInt(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic long getLong(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic long getLong(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic int getOffset()
public java.lang.String getSegmentName()
public short getShort(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic short getShort(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic java.lang.String getString(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic java.lang.String getString(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic java.sql.Time getTime(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic java.sql.Time getTime(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic java.sql.Timestamp getTimestamp(int index) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayDLIException
- if the conversion cannot be donepublic java.sql.Timestamp getTimestamp(java.lang.String fieldName) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayDLIException
- if the field name is not found in the segmentpublic DLITypeInfo[] getTypeInfo()
public DLITypeInfo getTypeInfo(int index)
index
- the 1-based index of the desired fieldpublic DLITypeInfo getTypeInfo(java.lang.String fieldName) throws DLIException
index
- the zero-based index of the desired fieldDLIException
- if the field does not existprotected DLIWarning getWarnings()
public void setBigDecimal(int index, java.math.BigDecimal value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setBigDecimal(java.lang.String fieldName, java.math.BigDecimal value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or if there is a conversion failurepublic void setBoolean(int index, boolean value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setBoolean(java.lang.String fieldName, boolean value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or if there is a conversion failurepublic void setByte(int index, byte value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setByte(java.lang.String fieldName, byte value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or if there is a conversion failureprotected void setBytes(byte[] value) throws java.lang.IllegalArgumentException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldpublic void setBytes(int index, byte[] value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldjava.lang.NumberFormatException
- if the length of the byte array is not equal to
the length of the field as defined in the DLITypeInfopublic void setBytes(java.lang.String fieldName, byte[] value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldjava.lang.NumberFormatException
- if the length of the byte array is not equal to
the length of the field as defined in the DLITypeInfoDLIException
- if the field name is not found in the segmentpublic void setDate(int index, java.sql.Date value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme for the Date when it is
formatted to a String is not supported or if
there is a conversion failurepublic void setDate(java.lang.String fieldName, java.sql.Date value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme for the Date when it is
formatted to a String is not supported, if
the field name is not found in the segment, or
if there is a conversion failurepublic void setDefaultEncoding(java.lang.String encoding)
encoding
- the character encodingDLITypeInfo
public void setDouble(int index, double value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setDouble(java.lang.String fieldName, double value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or there is a conversion failurepublic void setFloat(int index, float value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setFloat(java.lang.String fieldName, float value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or there is a conversion failurepublic void setInt(int index, int value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setInt(java.lang.String fieldName, int value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or if there is a conversion failurepublic void setLong(int index, long value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setLong(java.lang.String fieldName, long value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or if there is a conversion failurepublic void setShort(int index, short value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if there is a conversion failurepublic void setShort(java.lang.String fieldName, short value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment
or if there is a conversion failurepublic void setString(int index, java.lang.String value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme is not supported
or if there is a conversion failurepublic void setString(java.lang.String fieldName, java.lang.String value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the field name is not found in the segment,
if the encoding scheme is not supported, or if
there is a conversion failurepublic void setTime(int index, java.sql.Time value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme for the Time when it is
formatted to a String is not supported or if
there is a conversion failurepublic void setTime(java.lang.String fieldName, java.sql.Time value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme for the Time when it is
formatted to a String is not supported, if
the field name is not found in the segment, or
if there is a conversion failurepublic void setTimestamp(int index, java.sql.Timestamp value) throws DLIException
index
- the 1-based index of the desired field in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme for the Timestamp when it is
formatted to a String is not supported or if
there is a conversion failurepublic void setTimestamp(java.lang.String fieldName, java.sql.Timestamp value) throws DLIException
fieldName
- the name of the field as registered in the DLITypeInfo arrayvalue
- the new value for the fieldDLIException
- if the encoding scheme for the Timestamp when it is
formatted to a String is not supported, if
the field name is not found in the segment, or
if there is a conversion failure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |