|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jmobilecore.dstore.Record
public class Record
A Record
represents a database record
Field Summary | |
---|---|
protected static Record |
buffer
The buffer used for current Record compacting |
byte[] |
data
The data for the current Record |
int |
length
The length of the data |
static int |
MAX_SIZE
The maximum size for the record's data |
RecordStructure |
struct
The RecordStructure for the current Record |
Constructor Summary | |
---|---|
Record(RecordStructure rStructure)
Creates an Record instance |
|
Record(RecordStructure rStructure,
byte[] data)
Creates an Record instance |
Method Summary | |
---|---|
protected void |
calcLength()
|
protected void |
compact()
|
byte[] |
getBinaryField(int fIndex)
Retrieves the value of the designated column in the current Record as a byte[] |
byte[] |
getBinaryField(java.lang.String fName)
Retrieves the value of the designated column in the current Record as a byte[] |
boolean |
getBooleanField(int fIndex)
Retrieves the value of the designated column in the current Record as a boolean |
boolean |
getBooleanField(java.lang.String fName)
Retrieves the value of the designated column in the current Record as a boolean |
protected int |
getDescriptor(int fIndex)
Get descriptor for the specified field |
int |
getIntegerField(int fIndex)
Retrieves the value of the designated column in the current Record as a int |
int |
getIntegerField(java.lang.String fName)
Retrieves the value of the designated column in the current Record as a int |
java.lang.String |
getStringField(int fIndex)
Retrieves the value of the designated column in the current Record as a String |
java.lang.String |
getStringField(java.lang.String fName)
Retrieves the value of the designated column in the current Record as a String |
boolean |
isNull(int fIndex)
Reports whether the field has NULL value. |
boolean |
isNull(java.lang.String fName)
Retrieves whether the field has NULL value. |
void |
reset()
Reset data for current Record |
protected void |
setBinaryData(int fIndex,
byte[] value,
int offset,
int numBytes)
Sets specified column to byte[] value
Compacts storage if necessary |
void |
setBinaryField(int fIndex,
byte[] value,
int offset,
int numBytes)
Sets specified column to byte[] value |
void |
setBinaryField(java.lang.String fName,
byte[] value,
int offset,
int numBytes)
Sets specified column to byte[] value |
void |
setBooleanField(int fIndex,
boolean value)
Sets specified column to boolean value |
void |
setBooleanField(java.lang.String fName,
boolean value)
Sets specified column to boolean value |
protected void |
setDescriptor(int fIndex,
int desc)
Set descriptor for the specified field |
void |
setIntegerField(int fIndex,
int value)
Sets specified column to int value |
void |
setIntegerField(java.lang.String fName,
int value)
Sets specified column to int value |
void |
setNull(int fIndex)
Sets specified column to NULL value |
void |
setNull(java.lang.String fName)
Sets specified column to NULL value |
void |
setStringField(int fIndex,
java.lang.String value)
Sets specified column to String value |
void |
setStringField(java.lang.String fName,
java.lang.String value)
Sets specified column to String value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Record buffer
Record
compacting
public byte[] data
Record
public int length
public static int MAX_SIZE
public RecordStructure struct
RecordStructure
for the current Record
Constructor Detail |
---|
public Record(RecordStructure rStructure)
Record
instance
rStructure
- the RecordStructure
for the record.public Record(RecordStructure rStructure, byte[] data)
Record
instance
rStructure
- the RecordStructure
for the record.data
- the input data for the record.Method Detail |
---|
protected void calcLength()
protected void compact()
public byte[] getBinaryField(int fIndex)
Record
as a byte[]
fIndex
- the field index, the first field is 0, second is 1.
NULL
, the value returned is null
if the field index is not valid, the value returned is null
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenpublic byte[] getBinaryField(java.lang.String fName)
Record
as a byte[]
fName
- the field name.
NULL
, the value returned is null
if the field name is not valid, the value returned is null
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenpublic boolean getBooleanField(int fIndex)
Record
as a boolean
fIndex
- the field index, the first field is 0, second is 1.
NULL
, the value returned is true
if the field index is not valid, the value returned is false
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public boolean getBooleanField(java.lang.String fName)
Record
as a boolean
fName
- the field name.
NULL
, the value returned is true
if the field name is not valid, the value returned is false
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
protected int getDescriptor(int fIndex)
fIndex
- the field index, the first field is 0, second is 1.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenpublic int getIntegerField(int fIndex)
Record
as a int
fIndex
- the field index, the first field is 0, second is 1.
NULL
, the value returned is NULL
if the field index is not valid, the value returned is NULL
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public int getIntegerField(java.lang.String fName)
Record
as a int
fName
- the field name.
NULL
, the value returned is NULL
if the field name is not valid, the value returned is NULL
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
public java.lang.String getStringField(int fIndex)
Record
as a String
fIndex
- the field index, the first field is 0, second is 1.
NULL
, the value returned is null
;
if the field index is not valid, the value returned is null
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public java.lang.String getStringField(java.lang.String fName)
Record
as a String
fName
- the field name.
NULL
, the value returned is null
;
if the field name is not valid, the value returned is null
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
public boolean isNull(int fIndex)
NULL
value.
fIndex
- the field index, the first field is 0, second is 1.
true
if the field has NULL
value, false
otherwise
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public boolean isNull(java.lang.String fName)
NULL
value.
fName
- the field name.
true
if the field has NULL
value, false
otherwise
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
public void reset()
Record
protected void setBinaryData(int fIndex, byte[] value, int offset, int numBytes)
byte[]
value
Compacts storage if necessary
fIndex
- the field index.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field index was given
java.lang.ArrayStoreException
- if an invalid value cannot be stored in Record
FieldStructure.NULL
public void setBinaryField(int fIndex, byte[] value, int offset, int numBytes)
byte[]
value
fIndex
- the field index.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public void setBinaryField(java.lang.String fName, byte[] value, int offset, int numBytes)
byte[]
value
fName
- the field name.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
public void setBooleanField(int fIndex, boolean value)
boolean
value
fIndex
- the field index.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public void setBooleanField(java.lang.String fName, boolean value)
boolean
value
fName
- the field name.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
protected void setDescriptor(int fIndex, int desc)
fIndex
- the field index, the first field is 0, second is 1.desc
- the descriptor value.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenpublic void setIntegerField(int fIndex, int value)
int
value
fIndex
- the field index.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public void setIntegerField(java.lang.String fName, int value)
int
value
fName
- the field name.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
public void setNull(int fIndex)
NULL
value
fIndex
- the field index.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public void setNull(java.lang.String fName)
NULL
value
fName
- the field name.
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
public void setStringField(int fIndex, java.lang.String value)
String
value
fIndex
- the field index.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field index was givenFieldStructure.NULL
public void setStringField(java.lang.String fName, java.lang.String value)
String
value
fName
- the field name.value
- the field value.
java.lang.IndexOutOfBoundsException
- if an invalid field name was givenFieldStructure.NULL
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |