|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.as400.access.Record
The Record class represents the data described by a RecordFormat object. It can represent:
RecordDescriptionEvent
| Constructor Summary | |
Record()
Constructs a Record object. |
|
Record(RecordFormat recordFormat)
Constructs a Record object. |
|
Record(RecordFormat recordFormat,
byte[] contents)
Constructs a Record object. |
|
Record(RecordFormat recordFormat,
byte[] contents,
int offset)
Constructs a Record object. |
|
Record(RecordFormat recordFormat,
byte[] contents,
int offset,
java.lang.String recordName)
Constructs a Record object. |
|
Record(RecordFormat recordFormat,
byte[] contents,
java.lang.String recordName)
Constructs a Record object. |
|
Record(RecordFormat recordFormat,
java.lang.String recordName)
Constructs a Record object. |
|
| Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property is changed. |
void |
addRecordDescriptionListener(RecordDescriptionListener listener)
Adds a listener to be notified when a RecordDescriptionEvent is fired. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property is changed. |
byte[] |
getContents()
Returns the contents of this record as a byte array of AS400 data. |
void |
getContents(java.io.OutputStream out)
Writes the contents of this record to the specified output stream. |
java.lang.Object |
getField(int index)
Returns the value of the field by index. |
java.lang.Object |
getField(java.lang.String name)
Returns the value of the field by name. |
java.lang.Object[] |
getFields()
Returns the values of the fields in the record. |
java.lang.Object[] |
getKeyFields()
Returns the values of the key fields in the record. |
byte[] |
getKeyFieldsAsBytes()
Returns the values of the key fields in a byte array. |
int |
getNumberOfFields()
Returns the number of fields in this record. |
int |
getNumberOfKeyFields()
Returns the number of key fields in this record. |
RecordFormat |
getRecordFormat()
Returns the record format for this record. |
int |
getRecordLength()
Returns the record length of this record. |
java.lang.String |
getRecordName()
Returns the record name for this record. |
int |
getRecordNumber()
Returns the record number of this record. |
boolean |
isNullField(int index)
Indicates if the field is null. |
boolean |
isNullField(java.lang.String name)
Indicates if the field is null. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener from the change list. |
void |
removeRecordDescriptionListener(RecordDescriptionListener listener)
Removes a listener from the record description listeners list. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a listener from the veto change listeners list. |
void |
setContents(byte[] contents)
Sets the contents of this record from the specified byte array. |
void |
setContents(byte[] contents,
int offset)
Sets the contents of this record from the specified byte array. |
void |
setContents(java.io.InputStream in)
Sets the contents of this record from the specified input stream. |
void |
setField(int index,
java.lang.Object value)
Sets the contents of the field at index to value. |
void |
setField(java.lang.String name,
java.lang.Object value)
Sets the contents of the field with the specified name to value. |
void |
setRecordFormat(RecordFormat recordFormat)
Sets the record format for this record. |
void |
setRecordName(java.lang.String name)
Sets the name for this record. |
void |
setRecordNumber(int recordNumber)
Sets the record number of this record. |
java.lang.String |
toString()
Returns the contents of this record formatted as a String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Record()
public Record(RecordFormat recordFormat)
recordFormat - Describes the contents of this record.RecordFormat
public Record(RecordFormat recordFormat,
java.lang.String recordName)
recordFormat - Describes the contents of this record.recordName - The name to assign to the record.
public Record(RecordFormat recordFormat,
byte[] contents)
throws java.io.UnsupportedEncodingException
recordFormat - Describes the contents of this record.contents - The contents to which to initialize the record.
java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.
public Record(RecordFormat recordFormat,
byte[] contents,
java.lang.String recordName)
throws java.io.UnsupportedEncodingException
recordFormat - Describes the contents of this record.contents - The contents to which to initialize the record.
recordName - The name to assign to the record.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.
public Record(RecordFormat recordFormat,
byte[] contents,
int offset)
throws java.io.UnsupportedEncodingException
recordFormat - Describes the contents of this record. The recordFormat
must contain at least one field description.contents - The contents to which to initialize the record.
offset - The offset in contents at which to start. The offset cannot
be less than zero.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.
public Record(RecordFormat recordFormat,
byte[] contents,
int offset,
java.lang.String recordName)
throws java.io.UnsupportedEncodingException
recordFormat - Describes the contents of this record.contents - The contents to which to initialize the record.
offset - The offset in contents at which to start. The offset cannot
be less than zero.recordName - The name to assign to the record.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.| Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)public void addRecordDescriptionListener(RecordDescriptionListener listener)
listener - The RecordDescriptionListener.removeRecordDescriptionListener(com.ibm.as400.access.RecordDescriptionListener)public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener - The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public byte[] getContents()
throws java.io.CharConversionException,
java.io.UnsupportedEncodingException
java.io.CharConversionException - If an error occurs when converting
the contents of a field to AS400 data.java.io.UnsupportedEncodingException - If an error occurs when converting
the contents of a field to AS400 data.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void getContents(java.io.OutputStream out)
throws java.io.IOException
out - The stream to which to write the contents of the record.java.io.IOException - If an I/O error occurs while communicating with the AS/400.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public java.lang.Object getField(int index)
throws java.io.UnsupportedEncodingException
index - The position of the field in the record. This value must
be between 0 and getNumberOfFields() - 1 inclusive.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public java.lang.Object getField(java.lang.String name)
throws java.io.UnsupportedEncodingException
name - The name of the field.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public java.lang.Object[] getFields()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.
public java.lang.Object[] getKeyFields()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.public byte[] getKeyFieldsAsBytes()
public int getNumberOfFields()
public int getNumberOfKeyFields()
public RecordFormat getRecordFormat()
public int getRecordLength()
public java.lang.String getRecordName()
public int getRecordNumber()
public boolean isNullField(int index)
index - The index of the field. The index must be between
0 and getNumberOfFields() - 1.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)public boolean isNullField(java.lang.String name)
name - The name of the field.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)public void removeRecordDescriptionListener(RecordDescriptionListener listener)
listener - The RecordDescriptionListener.addRecordDescriptionListener(com.ibm.as400.access.RecordDescriptionListener)public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener - The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setContents(byte[] contents)
throws java.io.UnsupportedEncodingException
contents - The data with which to set the contents of this record.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setContents(byte[] contents,
int offset)
throws java.io.UnsupportedEncodingException
contents - The data with which to set the contents of this record.offset - The offset in contents at which to start.java.io.UnsupportedEncodingException - If an error occurs when converting
the AS400 data to a Java Object.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setContents(java.io.InputStream in)
throws java.io.IOException
in - The stream from which to read the data.java.io.IOException - If an I/O error occurs while communicating with the AS/400.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setField(int index,
java.lang.Object value)
index - The position in this record of the field whose contents are to be set. The index must be between 0 and getNumberOfFields() - 1.value - The value to which to set the contents of the field. Specify null for
value to indicate that the field is null.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setField(java.lang.String name,
java.lang.Object value)
name - The name of the field whose contents are to be set.value - The value to which to set the contents of the field. Specify null for
value to indicate that the field is null.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setRecordFormat(RecordFormat recordFormat)
throws java.beans.PropertyVetoException
recordFormat - The record format for this record.java.beans.PropertyVetoException - If a change is vetoed.
public void setRecordName(java.lang.String name)
throws java.beans.PropertyVetoException
name - The name for this record.java.beans.PropertyVetoException - If a change is vetoed.
public void setRecordNumber(int recordNumber)
throws java.beans.PropertyVetoException
recordNumber - The record number of this record. The
recordNumber must be greater than 0.java.beans.PropertyVetoException - If a change is vetoed.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||