com.sap.conn.jco
Interface JCoRecord

All Superinterfaces:
java.lang.Cloneable, java.lang.Iterable<JCoField>, java.io.Serializable
All Known Subinterfaces:
JCoAbapObject, JCoParameterList, JCoRequest, JCoResponse, JCoStructure, JCoTable

public interface JCoRecord
extends java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<JCoField>

Base interface for all data containers used throughout the JCo toolkit. Implementations take care of internal bookkeeping of buffers, meta data, etc. In addition it provides a rich set of get/set methods which allow a convenient access to the individual fields that make up a record. Getters and Setters support conversion of field values which are summarized by the following table:

method/type JCoMetaData.TYPE_CHAR JCoMetaData.TYPE_INT1 JCoMetaData.TYPE_INT2 JCoMetaData.TYPE_INT JCoMetaData.TYPE_NUM JCoMetaData.TYPE_BCD JCoMetaData.TYPE_FLOAT JCoMetaData.TYPE_BYTE JCoMetaData.TYPE_DATE JCoMetaData.TYPE_TIME JCoMetaData.TYPE_STRINGJCoMetaData.TYPE_XSTRING JCoMetaData.TYPE_DECF16 JCoMetaData.TYPE_DECF34JCoMetaData.TYPE_STRUCTUREJCoMetaData.TYPE_TABLE
Object getValue() String Integer Integer Integer String BigDecimal Double byte[] Date Date String byte[] BigDecimal BigDecimal JCoStructure JCoTable
String getString() String String String String String String String String (hex) String String String String (hex) String String String (Name) String (Name)
char getChar() char --- --- --- --- --- --- --- --- --- char --- --- --- --- ---
char getCharArray() char[] --- --- --- --- --- --- --- --- --- char[] --- --- --- --- ---
byte getByte() byte byte byte byte byte --- --- byte --- --- byte byte --- --- --- ---
short getShort() short short short short short --- --- short --- --- short short --- --- --- ---
int getInt() int int int int int --- --- int --- --- int int --- --- --- ---
long getLong() long long long long long --- --- long --- --- long long --- --- --- ---
BigInteger getBigInteger() BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger --- --- --- --- BigInteger --- --- --- --- ---
double getFloat() float float float float float float float --- --- --- float --- --- --- --- ---
double getDouble() double double double double double double double --- --- --- double --- --- --- --- ---
BigDecimal getBigDecimal() BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal --- --- --- BigDecimal --- BigDecimal BigDecimal --- ---
java.lang.Date getDate() Date --- --- --- --- --- --- --- Date Date Date --- --- --- --- ---
java.lang.Date getTime() Date --- --- --- --- --- --- --- Date Date Date --- --- --- --- ---
byte[] getByteArray() byte[] --- --- --- --- --- --- byte[] --- --- byte[] byte[] byte[] byte[] --- ---
InputStream getBinaryStream() InputStream --- --- --- --- --- --- InputStream --- --- InputStream InputStream --- --- --- ---
Reader getCharacterStream() Reader --- --- --- --- --- --- --- --- --- Reader --- --- --- --- ---
JCoStructure getStructure() --- --- --- --- --- --- --- --- --- --- --- --- JCoStructure --- --- ---
JCoTable getTable() --- --- --- --- --- --- --- --- --- --- --- --- --- JCoTable --- ---


Method Summary
 void clear()
          Clears the record, i.e.
 java.lang.Object clone()
          Clones the record instance
 int copyFrom(JCoRecord source)
          Copies the matching fields from the source record into this record Data fields are considered to be equivalent if the name and type of two fields match.
 JCoAbapObject getAbapObject(int index)
          Returns the value of the specified field as a JCoAbapObject.
 JCoAbapObject getAbapObject(java.lang.String fieldName)
          Returns the value of the specified field as a JCoAbapObject.
 java.math.BigDecimal getBigDecimal(int index)
          Returns the value of the i'th field as a BigDecimal object
 java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
          Returns the value of the i'th field as a BigDecimal object
 java.math.BigInteger getBigInteger(int index)
          Returns the value of the i'th field as a BigInteger object
 java.math.BigInteger getBigInteger(java.lang.String fieldName)
          Returns the value of the i'th field as a BigInteger object
 java.io.InputStream getBinaryStream(int index)
          Returns the value of the i'th field as a stream of uninterpreted bytes, i.e.
 java.io.InputStream getBinaryStream(java.lang.String fieldName)
          Returns the value of the named field as a stream of uninterpreted bytes, i.e.
 byte getByte(int index)
          Returns the value of the i'th field as a byte
 byte getByte(java.lang.String fieldName)
          Returns the value of the named field as a byte
 byte[] getByteArray(int index)
          Returns the value of the i'th field as a byte array
 byte[] getByteArray(java.lang.String fieldName)
          Returns the value of the i'th field as a byte[] array
 char getChar(int index)
          Returns the value of the i'th field as a char
 char getChar(java.lang.String fieldName)
          Returns the value of the named field as a char
 java.io.Reader getCharacterStream(int index)
          Returns the value of the i'th field as a java.io.Reader object
 java.io.Reader getCharacterStream(java.lang.String fieldName)
          Returns the value of the named field as a stream of characters, i.e.
 char[] getCharArray(int index)
          Returns the value of the i'th field as a char array.
 char[] getCharArray(java.lang.String fieldName)
          Returns the value of the i'th field as a char[] array
 java.lang.String getClassNameOfValue(java.lang.String fieldName)
          Returns the fully-qualified name of the Java class whose instances are manufactured if the methods getValue(int index) or getValue(String fieldName) are called to retrieve a calue from the field.
 java.util.Date getDate(int index)
          Returns the value of the i'th field as a date
 java.util.Date getDate(java.lang.String fieldName)
          Returns the value of the named field as a Date object
 double getDouble(int index)
          Returns the value of the i'th field as a double
 double getDouble(java.lang.String fieldName)
          Returns the value of the named field as a double
 int getFieldCount()
          Returns the number of fields in the record
 JCoFieldIterator getFieldIterator()
          Returns a JCoFieldIterator.
 float getFloat(int index)
          Returns the value of the i'th field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 float getFloat(java.lang.String fieldName)
          Returns the value of the named field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 int getInt(int index)
          Returns the value of the i'th field as an integer
 int getInt(java.lang.String fieldName)
          Returns the value of the named field as an integer
 long getLong(int index)
          Returns the value of the i'th field as a long
 long getLong(java.lang.String fieldName)
          Returns the value of the named field as a long
 JCoMetaData getMetaData()
          returns the appropriated meta data object, that was used for creation of this record
 short getShort(int index)
          Returns the value of the i'th field as a short
 short getShort(java.lang.String fieldName)
          Returns the value of the named field as a short
 java.lang.String getString(int index)
          Returns the value of the i'th field as a string.
 java.lang.String getString(java.lang.String fieldName)
          Returns the value of the named field as a java.lang.String object
 JCoStructure getStructure(int index)
          Returns the value of the i'th field as a JCoStructure
 JCoStructure getStructure(java.lang.String fieldName)
          Returns the value of the named field as a JCoStructure object
 JCoTable getTable(int index)
          Returns the value of the i'th field as a table
 JCoTable getTable(java.lang.String fieldName)
          Returns the value of the named field as a JCoTable object
 java.util.Date getTime(int index)
          Returns the value of the i'th field as a date
 java.util.Date getTime(java.lang.String fieldName)
          Returns the value of the named field as a Date object
 java.lang.Object getValue(int index)
          Generic method that returns the value of the i'th field as an object.
 java.lang.Object getValue(java.lang.String fieldName)
          Returns the value of the named field as an object
 boolean isInitialized(int index)
          Checks whether this field has been initialized
 boolean isInitialized(java.lang.String fieldName)
          Checks whether this field has been initialized
 java.util.Iterator<JCoField> iterator()
          Returns an Iterator.
 void setValue(int index, java.math.BigDecimal value)
          Sets the BigDecimal as the value for the i'th field
 void setValue(int index, byte value)
          Sets the byte as the value for the i'th field
 void setValue(int index, byte[] value)
          Sets the byte array as the value for the i'th field
 void setValue(int index, char value)
          Sets the specified character as the field's value.
 void setValue(int index, char[] value)
          Sets the specified character array as the field's value.
 void setValue(int index, char[] value, int from, int length)
          Sets the specified character array as the field's value.
 void setValue(int index, double value)
          Sets the double as the value for the i'th field
 void setValue(int index, float value)
          Sets the float as the value for the i'th field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 void setValue(int index, int value)
          Sets the int as the value for the i'th field
 void setValue(int index, JCoAbapObject abapObject)
          Sets the value of the specified field to be the given JCoAbapObject.
 void setValue(int index, JCoStructure value)
          Sets the structure as the value for the i'th field
 void setValue(int index, JCoTable value)
          Sets the table as the value for the i'th field
 void setValue(int index, long value)
          Sets the long as the value for the i'th field
 void setValue(int index, java.lang.Object value)
          Sets the object as the value for the i'th field
 void setValue(int index, short value)
          Sets the short as the value for the i'th field
 void setValue(int index, java.lang.String value)
          Sets the specified string as the field's value.
 void setValue(java.lang.String name, java.math.BigDecimal value)
          Sets the BigDecimal as the value for the named field
 void setValue(java.lang.String name, byte value)
          Sets the byte as the value for the named field
 void setValue(java.lang.String name, byte[] value)
          Sets the byte array as the value for the named field
 void setValue(java.lang.String name, char value)
          Sets the character as the value for the named field.
 void setValue(java.lang.String name, char[] value)
          Sets the specified character array as the value for the named field.
 void setValue(java.lang.String name, char[] value, int from, int length)
          Sets the specified character array as the value for the named field.
 void setValue(java.lang.String name, double value)
          Sets the double as the value for the named field
 void setValue(java.lang.String name, float value)
          Sets the float as the value for the named field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values.
 void setValue(java.lang.String name, int value)
          Sets the int as the value for the named field
 void setValue(java.lang.String fieldName, JCoAbapObject abapObject)
          Sets the value of the specified field to be the given JCoAbapObject.
 void setValue(java.lang.String name, JCoStructure value)
          Sets the structure as the value for the named field
 void setValue(java.lang.String name, JCoTable value)
          Sets the table as the value for the named field
 void setValue(java.lang.String name, long value)
          Sets the long as the value for the named field.
 void setValue(java.lang.String name, java.lang.Object value)
          Sets the object as the value for the named field
 void setValue(java.lang.String name, short value)
          Sets the short as the value for the named field.
 void setValue(java.lang.String name, java.lang.String value)
          Sets the string as the value for the named field.
 java.lang.String toXML()
          Returns the whole record in XML format.
 java.lang.String toXML(int index)
          Returns the value of the i'th field as a XML string.
 java.lang.String toXML(java.lang.String fieldName)
          Returns the value of named field as a XML string.
 java.io.Writer write(int index, java.io.Writer writer)
          Writes the field specified by index to writer.
 java.io.Writer write(java.lang.String fieldName, java.io.Writer writer)
          Writes the named field to writer.
 

Method Detail

getMetaData

JCoMetaData getMetaData()
returns the appropriated meta data object, that was used for creation of this record

Returns:
MetaData instance of the appropriated meta data object

clear

void clear()
Clears the record, i.e. resets everything to its initial state


clone

java.lang.Object clone()
Clones the record instance

Returns:
a cloned instance of JCorecord

copyFrom

int copyFrom(JCoRecord source)
Copies the matching fields from the source record into this record Data fields are considered to be equivalent if the name and type of two fields match. The data will be copied and converted as best as can, i.e. strings will be cut off if the source field is longer than the destination field, or they will be filled with spaces if the source is shorter than the destination, etc. If a single conversion fails, the whole copy operation will fail and the record will be left untouched. If the JCoRecord is a JCoTable, then the data from the source will be appended. This means that, if the source is a JCoStructure a single row will be appended to the end of the JCoTable, and if the source is a JCoTable all its rows will be appended to the end of the JCoTable.
If the JCoRecord is a JCoStructure or a JCoParameterList the data will be overwritten by the source. In case that the source is a JCoTable, the data is copied from the current row, i.e. the row the row pointer points to.

Parameters:
source - the source record from which to copy the data
Returns:
the number of matching fields (columns)
Throws:
JCoRuntimeException - if something went wrong

getFieldCount

int getFieldCount()
Returns the number of fields in the record

Returns:
the number of fields

getValue

java.lang.Object getValue(int index)
Generic method that returns the value of the i'th field as an object. Depending on the type of the field the method returns the following object:
type JCoMetaData.TYPE_CHAR JCoMetaData.TYPE_INT1 JCoMetaData.TYPE_INT2 JCoMetaData.TYPE_INT JCoMetaData.TYPE_NUM JCoMetaData.TYPE_BCD JCoMetaData.TYPE_FLOAT JCoMetaData.TYPE_BYTE JCoMetaData.TYPE_DATE JCoMetaData.TYPE_TIME JCoMetaData.TYPE_STRINGJCoMetaData.TYPE_XSTRING JCoMetaData.TYPE_DECF16 JCoMetaData.TYPE_DECF34JCoMetaData.TYPE_STRUCTUREJCoMetaData.TYPE_TABLE
object String Integer Integer Integer String BigDecimal Double byte[] Date Date String byte[] BigDecimal BigDecimal JCoStructure JCoTable

Parameters:
index - the field index
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to an object
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getValue

java.lang.Object getValue(java.lang.String fieldName)
Returns the value of the named field as an object

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to an Object
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getString

java.lang.String getString(int index)
Returns the value of the i'th field as a string. If the data type of the field is CHAR or STRING, the return value all trailing balancks

Parameters:
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to a String
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getChar

char getChar(int index)
Returns the value of the i'th field as a char

Parameters:
index - the index of the field
Returns:
the character of the field or ' ' if the field was empty.
Throws:
ConversionException - thrown if the value could not be converted to a char, i.e. if the underlying field contained more than one character
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getByte

byte getByte(int index)
Returns the value of the i'th field as a byte

Parameters:
index - the index of the field
Returns:
the field's value as a byte
Throws:
ConversionException - thrown if the value could not be converted to a byte
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getByte

byte getByte(java.lang.String fieldName)
Returns the value of the named field as a byte

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a byte
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getFloat

float getFloat(int index)
Returns the value of the i'th field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. Double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because i.e. setting your values with setValue(float value, ...) and getting them using getDouble(...) may return not the same value.

Parameters:
index - the index of the field
Returns:
the field's value as a float
Throws:
ConversionException - thrown if the value could not be converted to a float

getFloat

float getFloat(java.lang.String fieldName)
Returns the value of the named field as a float Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. Double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because i.e. setting your values with setValue(float value, ...) and getting them using getDouble(...) may return not the same value.

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a float
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getShort

short getShort(int index)
Returns the value of the i'th field as a short

Parameters:
index - the index of the field
Returns:
the field's value as a short
Throws:
ConversionException - thrown if the value could not be converted to a short

getInt

int getInt(int index)
Returns the value of the i'th field as an integer

Parameters:
index - the index of the field
Returns:
the field's value as an integer
Throws:
ConversionException - thrown if the value could not be converted to an int

getLong

long getLong(int index)
Returns the value of the i'th field as a long

Parameters:
index - the index of the field
Returns:
the field's value as a long
Throws:
ConversionException - thrown if the value could not be converted to an long
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getBigInteger

java.math.BigInteger getBigInteger(int index)
Returns the value of the i'th field as a BigInteger object

Parameters:
index - the index of the field
Returns:
the field's value as a BigInteger object
Throws:
ConversionException - thrown if the value could not be converted to a BigInteger
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getDouble

double getDouble(int index)
Returns the value of the i'th field as a double

Parameters:
index - the index of the field
Returns:
the field's value as a double
Throws:
ConversionException - thrown if the value could not be converted to a double
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getBigDecimal

java.math.BigDecimal getBigDecimal(int index)
Returns the value of the i'th field as a BigDecimal object

Parameters:
index - the index of the field
Returns:
the field's value as a BigDecimal object
Throws:
ConversionException - thrown if the value could not be converted to a BigDecimal
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getDate

java.util.Date getDate(int index)
Returns the value of the i'th field as a date

Parameters:
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to a Date
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getTime

java.util.Date getTime(int index)
Returns the value of the i'th field as a date

Parameters:
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to a Date
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getByteArray

byte[] getByteArray(int index)
Returns the value of the i'th field as a byte array

Parameters:
index - the field index
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a byte array
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getCharArray

char[] getCharArray(int index)
Returns the value of the i'th field as a char array.
This is only possible for fields of type Note: the date or time fields a plain character array without format chars as : or - will be returned

Parameters:
index - the field index
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a char array
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getBinaryStream

java.io.InputStream getBinaryStream(int index)
Returns the value of the i'th field as a stream of uninterpreted bytes, i.e. an java.io.InputStream object

Parameters:
index - the index of the field
Returns:
the field's value as an InputStream
Throws:
ConversionException - thrown if the value could not be converted to an java.io.InputStream
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getCharacterStream

java.io.Reader getCharacterStream(int index)
Returns the value of the i'th field as a java.io.Reader object

Parameters:
index - the index of the field
Returns:
the field's value as a java.io.Reader
Throws:
ConversionException - thrown if the value could not be converted to a java.io.Reader
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

getTable

JCoTable getTable(int index)
Returns the value of the i'th field as a table

Parameters:
index - the index of the field
Returns:
the field's value as a JCoTable
Throws:
ConversionException - thrown if the value could not be converted to a JCoTable
java.lang.IndexOutOfBoundsException - thrown if the index is out of range
See Also:
JCoTable

getStructure

JCoStructure getStructure(int index)
Returns the value of the i'th field as a JCoStructure

Parameters:
index - the index of the field
Returns:
the field's value as a JCoStructure
Throws:
ConversionException - thrown if the value could not be converted to a JCoStructure
java.lang.IndexOutOfBoundsException - thrown if the index is out of range
See Also:
JCoStructure

toXML

java.lang.String toXML(int index)
Returns the value of the i'th field as a XML string.

Note:All documents generated here are comply strictly to the encoding scheme as described for the method toXML().

Parameters:
index - the index of the field
Returns:
the record in XML format
Throws:
ConversionException - thrown if the value could not be converted to a String
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

toXML

java.lang.String toXML(java.lang.String fieldName)
Returns the value of named field as a XML string.

Parameters:
fieldName - the name of the field
Returns:
the record in XML format
Throws:
ConversionException - thrown if the value could not be converted to a String
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

toXML

java.lang.String toXML()
Returns the whole record in XML format.

Note:All documents generated here are comply strictly to the encoding scheme as described for the method toXML().

Returns:
the record in XML format
Throws:
ConversionException - thrown if the value could not be converted to a String

write

java.io.Writer write(int index,
                     java.io.Writer writer)
                     throws java.io.IOException
Writes the field specified by index to writer. The method writes out the internal char array representation avoiding temporary objects. The output depends on the field type.
Field typeoutput to writer
TYPE_CHARchar buffer without trailing spaces
TYPE_DATEchars in format YYYYMMDD
TYPE_TIME chars in format HHMMSS
TYPE_NUM char buffer
TYPE_STRING string chars buffer
TYPE_XSTRING HEX representation of the xstring byte buffer
TYPE_BYTE HEX representation of the byte buffer
TYPE_BCD char based representation of the number
TYPE_FLOAT char based representation of the number
TYPE_INT char based representation of the number
TYPE_INT2 char based representation of the number
TYPE_INT1 char based representation of the number
TYPE_DECF16 char based representation of the number
TYPE_DECF34 char based representation of the number
TYPE_STRUCTURE not possible, exception will be thrown
TYPE_TABLE not possible, exception will be thrown
TYPE_ABAPOBJECTnot possible, exception will be thrown

Parameters:
index - of the field, that should be written to out
writer - writer instance used to write
Returns:
the instance passed as parameter writer
Throws:
ConversionException - if the field is complex.
JCoRuntimeException - with the key JCoException.JCO_ERROR_FIELD_NOT_FOUND if the field with the name is not available.
java.io.IOException - if writer throws IOException
Since:
JCo 3.0.7

write

java.io.Writer write(java.lang.String fieldName,
                     java.io.Writer writer)
                     throws java.io.IOException
Writes the named field to writer.

Parameters:
fieldName - name of the field
writer - write that is used to write operation
Returns:
the instance passed as parameter writer
Throws:
ConversionException - if the field is complex.
JCoRuntimeException - with the key JCoException.JCO_ERROR_FIELD_NOT_FOUND if the field with the name is not available.
java.io.IOException - if writer throws IOException
Since:
JCo 3.0.7
See Also:
write(int, Writer)

setValue

void setValue(int index,
              java.lang.String value)
Sets the specified string as the field's value. To set a value back to its initial type specific setting pass "", i.e. an empty string, or null

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation

getClassNameOfValue

java.lang.String getClassNameOfValue(java.lang.String fieldName)
Returns the fully-qualified name of the Java class whose instances are manufactured if the methods getValue(int index) or getValue(String fieldName) are called to retrieve a calue from the field.

Parameters:
fieldName - the name of the field
Returns:
the fully-qualified class name of the value object
Throws:
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getString

java.lang.String getString(java.lang.String fieldName)
Returns the value of the named field as a java.lang.String object

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a String
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getChar

char getChar(java.lang.String fieldName)
Returns the value of the named field as a char

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a char
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getShort

short getShort(java.lang.String fieldName)
Returns the value of the named field as a short

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a short
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getInt

int getInt(java.lang.String fieldName)
Returns the value of the named field as an integer

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to an int
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getLong

long getLong(java.lang.String fieldName)
Returns the value of the named field as a long

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a long
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getBigInteger

java.math.BigInteger getBigInteger(java.lang.String fieldName)
Returns the value of the i'th field as a BigInteger object

Parameters:
fieldName - the name of the field
Returns:
the field's value as a BigInteger object
Throws:
ConversionException - thrown if the value could not be converted to a BigInteger
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getDouble

double getDouble(java.lang.String fieldName)
Returns the value of the named field as a double

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a double
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getBigDecimal

java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
Returns the value of the i'th field as a BigDecimal object

Parameters:
fieldName - the name of the field
Returns:
the field's value as a BigDecimal object
Throws:
ConversionException - thrown if the value could not be converted to a BigDecimal
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getDate

java.util.Date getDate(java.lang.String fieldName)
Returns the value of the named field as a Date object

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a Date
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getTime

java.util.Date getTime(java.lang.String fieldName)
Returns the value of the named field as a Date object

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a Date
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getByteArray

byte[] getByteArray(java.lang.String fieldName)
Returns the value of the i'th field as a byte[] array

Parameters:
fieldName - the name of the field
Returns:
the field's value as a byte array
Throws:
ConversionException - thrown if the value could not be converted to a byte[] array
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getCharArray

char[] getCharArray(java.lang.String fieldName)
Returns the value of the i'th field as a char[] array

Parameters:
fieldName - the name of the field
Returns:
the field's value as a char array
Throws:
ConversionException - thrown if the value could not be converted to a byte[] array
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getBinaryStream

java.io.InputStream getBinaryStream(java.lang.String fieldName)
Returns the value of the named field as a stream of uninterpreted bytes, i.e. a java.io.InputStream object

Parameters:
fieldName - the name of the field
Returns:
the field's value as a java.io.InputStream
Throws:
ConversionException - thrown if the value could not be converted to a java.io.InputStream
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getCharacterStream

java.io.Reader getCharacterStream(java.lang.String fieldName)
Returns the value of the named field as a stream of characters, i.e. a java.io.Reader object

Parameters:
fieldName - the name of the field
Returns:
the field's value as a java.io.Reader
Throws:
ConversionException - thrown if the value could not be converted to a java.io.Reader
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getTable

JCoTable getTable(java.lang.String fieldName)
Returns the value of the named field as a JCoTable object

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a JCoTable
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getStructure

JCoStructure getStructure(java.lang.String fieldName)
Returns the value of the named field as a JCoStructure object

Parameters:
fieldName - the name of the field
Returns:
the value of the specified field
Throws:
ConversionException - thrown if the value could not be converted to a JCoStructure
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(int index,
              char value)
Sets the specified character as the field's value.

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              char[] value)
Sets the specified character array as the field's value.

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              char[] value,
              int from,
              int length)
Sets the specified character array as the field's value.
Allowed for rfc types CHAR and STRING

Parameters:
value - the value to set for the field
from - offset in the char array
length - count of chars that will be set as field's value
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              short value)
Sets the short as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              int value)
Sets the int as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              long value)
Sets the long as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              double value)
Sets the double as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              byte[] value)
Sets the byte array as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              JCoStructure value)
Sets the structure as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              JCoTable value)
Sets the table as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(int index,
              java.lang.Object value)
Sets the object as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(java.lang.String name,
              java.lang.String value)
Sets the string as the value for the named field. To set a value back to its initial type specific setting pass "", i.e. an empty string, or null

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              char[] value)
Sets the specified character array as the value for the named field.

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              char[] value,
              int from,
              int length)
Sets the specified character array as the value for the named field.

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              char value)
Sets the character as the value for the named field.

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              short value)
Sets the short as the value for the named field.

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              int value)
Sets the int as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              long value)
Sets the long as the value for the named field.

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              double value)
Sets the double as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(int index,
              float value)
Sets the float as the value for the i'th field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. A double value converted to float and back to double may differ from the original value. Please also don't mix those methods, because e.g. setting your values with setValue(float value, ...) and getting them using getDouble(...) may not return the same value.

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(java.lang.String name,
              float value)
Sets the float as the value for the named field Please use setValue(float value, ...) and getFloat(...) methods only if you operate with float values. A double value converted to float and back to double may also differ from original value. Please also don't mix those methods, because e.g. setting your values with setValue(float value, ...) and getting them using getDouble(...) may not return the same value.

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(int index,
              java.math.BigDecimal value)
Sets the BigDecimal as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(java.lang.String name,
              java.math.BigDecimal value)
Sets the BigDecimal as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(int index,
              byte value)
Sets the byte as the value for the i'th field

Parameters:
value - the value to set for the field
index - the index of the field
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

setValue

void setValue(java.lang.String name,
              byte value)
Sets the byte as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              byte[] value)
Sets the byte array as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              JCoStructure value)
Sets the structure as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              JCoTable value)
Sets the table as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

setValue

void setValue(java.lang.String name,
              java.lang.Object value)
Sets the object as the value for the named field

Parameters:
value - the value to set for the field
name - the name of the field to set
Throws:
ConversionException - thrown if the value could not be converted to its internal representation
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

getAbapObject

JCoAbapObject getAbapObject(java.lang.String fieldName)
Returns the value of the specified field as a JCoAbapObject.

Parameters:
fieldName - the name of the field
Returns:
the value of the field as a JCoAbapObject

getAbapObject

JCoAbapObject getAbapObject(int index)
Returns the value of the specified field as a JCoAbapObject.

Parameters:
index - the index of the field
Returns:
the value of the field as a JCoAbapObject

setValue

void setValue(java.lang.String fieldName,
              JCoAbapObject abapObject)
Sets the value of the specified field to be the given JCoAbapObject.

Parameters:
fieldName - the name of the field
abapObject - the value, a JCoAbapObject

setValue

void setValue(int index,
              JCoAbapObject abapObject)
Sets the value of the specified field to be the given JCoAbapObject.

Parameters:
index - the index of the field
abapObject - the value, a JCoAbapObject

isInitialized

boolean isInitialized(java.lang.String fieldName)
Checks whether this field has been initialized

Parameters:
fieldName - of field that will be checked
Returns:
true if the field has been initialized, false otherwise
Throws:
JCoRuntimeException - thrown with group JCO_ERROR_FIELD_NOT_FOUND if a field with the specified name does not exist

isInitialized

boolean isInitialized(int index)
Checks whether this field has been initialized

Parameters:
index - of field that will be checked
Returns:
true if the field has been initialized, false otherwise
Throws:
java.lang.IndexOutOfBoundsException - thrown if the index is out of range

iterator

java.util.Iterator<JCoField> iterator()
Returns an Iterator.
Note: The remove is not supported by JCoRecord

Specified by:
iterator in interface java.lang.Iterable<JCoField>
Returns:
iterator

getFieldIterator

JCoFieldIterator getFieldIterator()
Returns a JCoFieldIterator.

Returns:
iterator


Copyright © 2008-2014 SAP AG. All Rights Reserved.