|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.access.Record
public class Record extends Object implements Serializable
The Record class represents the data described by a RecordFormat object. It can represent:
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,
String recordName)
Constructs a Record object. |
Record(RecordFormat recordFormat,
byte[] contents,
String recordName)
Constructs a Record object. |
Record(RecordFormat recordFormat,
String recordName)
Constructs a Record object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(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(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property is changed. |
boolean |
equals(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(OutputStream out)
Writes the contents of this record to the specified output stream. |
Object |
getField(int index)
Returns the value of the field by index. |
Object |
getField(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(String name)
Returns the value of the field by name, as an unconverted byte array. |
Object[] |
getFields()
Returns the values of the fields in the record. |
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. |
String |
getRecordName()
Returns the record name for this record. |
int |
getRecordNumber()
Returns the record number 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(String name)
Indicates if the field is null. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener from the change list. |
void |
removeRecordDescriptionListener(RecordDescriptionListener listener)
Removes a listener from the record description listeners list. |
void |
removeVetoableChangeListener(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(InputStream in)
Sets the contents of this record from the specified input stream. |
void |
setField(int index,
Object value)
Sets the contents of the field at index to value. |
void |
setField(String name,
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(String name)
Sets the name for this record. |
void |
setRecordNumber(int recordNumber)
Sets the record number of this record. |
String |
toString()
Returns the contents of this record formatted as a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, 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,
String recordName)
recordFormat - Describes the contents of this record.recordName - The name to assign to the record.
public Record(RecordFormat recordFormat,
byte[] contents)
throws UnsupportedEncodingException
recordFormat - Describes the contents of this record.contents - The contents to which to initialize the record.
UnsupportedEncodingException - If an error occurs when converting
the IBM i data to a Java Object.
public Record(RecordFormat recordFormat,
byte[] contents,
String recordName)
throws 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.UnsupportedEncodingException - If an error occurs when converting
the IBM i data to a Java Object.
public Record(RecordFormat recordFormat,
byte[] contents,
int offset)
throws 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.UnsupportedEncodingException - If an error occurs when converting
the IBM i data to a Java Object.
public Record(RecordFormat recordFormat,
byte[] contents,
int offset,
String recordName)
throws 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.UnsupportedEncodingException - If an error occurs when converting
the IBM i data to a Java Object.| Method Detail |
|---|
public void addPropertyChangeListener(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(VetoableChangeListener listener)
listener - The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)public boolean equals(Object obj)
equals in class Objectobj - The Object to compare.
public byte[] getContents()
throws CharConversionException,
UnsupportedEncodingException
CharConversionException - If an error occurs when converting
the contents of a field to IBM i data.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(OutputStream out)
throws IOException
out - The stream to which to write the contents of the record.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 Object getField(int index)
throws UnsupportedEncodingException
index - The ordinal position of the field in the record. This value must
be between 0 and getNumberOfFields() - 1 inclusive.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 Object getField(String name)
throws UnsupportedEncodingException
name - The name of the field.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(String name)
name - The name of the field.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public Object[] getFields()
throws UnsupportedEncodingException
UnsupportedEncodingException - If an error occurs when converting
the IBM i data to a Java Object.
public Object[] getKeyFields()
throws UnsupportedEncodingException
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 String getRecordName()
public int getRecordNumber()
public int hashCode()
hashCode in class Objectpublic 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(String name)
name - The name of the field.Record(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)public void removePropertyChangeListener(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(VetoableChangeListener listener)
listener - The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setContents(byte[] contents)
throws UnsupportedEncodingException
contents - The data with which to set the contents of this record.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 UnsupportedEncodingException
contents - The data with which to set the contents of this record.offset - The offset in contents at which to start.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(InputStream in)
throws IOException
in - The stream from which to read the data.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,
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.UnsupportedEncodingExceptionRecord(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setField(String name,
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.UnsupportedEncodingExceptionRecord(com.ibm.as400.access.RecordFormat),
setRecordFormat(com.ibm.as400.access.RecordFormat)
public void setRecordFormat(RecordFormat recordFormat)
throws PropertyVetoException
recordFormat - The record format for this record.PropertyVetoException - If a change is vetoed.
public void setRecordName(String name)
throws PropertyVetoException
name - The name for this record.PropertyVetoException - If a change is vetoed.
public void setRecordNumber(int recordNumber)
throws PropertyVetoException
recordNumber - The record number of this record. The
recordNumber must be greater than 0.PropertyVetoException - If a change is vetoed.public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||