public class Record
extends java.lang.Object
implements java.io.Serializable
RecordDescriptionEvent
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
equals(java.lang.Object obj)
Tests this Record object for equality with the given object.
|
byte[] |
getContents()
Returns the contents of this record as a byte array of IBM i 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.
|
byte[] |
getFieldAsBytes(int index)
Returns the value of the field by index, as an unconverted byte array.
|
byte[] |
getFieldAsBytes(java.lang.String name)
Returns the value of the field by name, as an unconverted byte array.
|
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.
|
long |
getRecordNumberLong()
Returns the record number in long type of this record.
|
int |
hashCode()
Returns a hash code value for 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.
|
void |
setRecordNumberLong(long recordNumber)
Sets the record number with long type of this record.
|
java.lang.String |
toString()
Returns the contents of this record formatted as a String.
|
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 IBM i 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 IBM i 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 IBM i 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 IBM i data to a Java Object.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 boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The Object to compare.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 IBM i data.java.io.UnsupportedEncodingException
- If an error occurs when converting
the contents of a field to IBM i 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 system.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 ordinal 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 IBM i 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 IBM i data to a Java Object.Record(com.ibm.as400.access.RecordFormat)
,
setRecordFormat(com.ibm.as400.access.RecordFormat)
public byte[] getFieldAsBytes(int index)
index
- The ordinal position of the field in the record. This value must
be between 0 and getNumberOfFields() - 1 inclusive.Record(com.ibm.as400.access.RecordFormat)
,
setRecordFormat(com.ibm.as400.access.RecordFormat)
public byte[] getFieldAsBytes(java.lang.String name)
name
- The name of the field.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 IBM i data to a Java Object.public java.lang.Object[] getKeyFields() throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- If an error occurs when converting
the IBM i 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 long getRecordNumberLong()
public int hashCode()
hashCode
in class java.lang.Object
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 IBM i 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 IBM i 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 system.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 void setRecordNumberLong(long recordNumber) throws java.beans.PropertyVetoException
recordNumber
- java.beans.PropertyVetoException
- If the recipient wishes the property change to be rolled back.public java.lang.String toString()
toString
in class java.lang.Object