|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.dstore.Table
public abstract class Table
An abstract base class for record stores
Field Summary | |
---|---|
static int |
INVALID_RECORD_ID
The invalid record id |
protected boolean |
isOpen
Indicates whether the RMStorage is open |
javax.microedition.rms.RecordComparator |
loadComparator
The RecordComparator for data loading |
javax.microedition.rms.RecordFilter |
loadFilter
The RecordFilter for data loading |
boolean |
loadKeepUpdated
The keepUpdated flag for data loading |
javax.microedition.rms.RecordStore |
recordStore
The RecordStore for storing table data |
RecordStructure |
structure
The RecordStructure for the current Record |
Constructor Summary | |
---|---|
Table(java.lang.String name,
boolean create)
Creates new instance of Table class and opens data store |
Method Summary | |
---|---|
int |
addRecord(Record rec)
Adds new record to data store The record store should be open. |
boolean |
close()
Closes the data store. |
static boolean |
delete(java.lang.String name)
Deletes the named record store. |
boolean |
deleteRecord(int id)
Deletes data from the table The record store should be open. |
int |
getNumRecords()
Returns the number of records currently in the record store. |
boolean |
load()
Iterates through records in the record store |
boolean |
open(java.lang.String name,
boolean create)
Opens data store |
abstract boolean |
processRecord(byte[] data,
int recId)
Abstract method for processing record of current Table |
boolean |
setRecord(int id,
Record rec)
Sets data to the specified record The record store should be open. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INVALID_RECORD_ID
protected boolean isOpen
public javax.microedition.rms.RecordComparator loadComparator
RecordComparator
for data loading
public javax.microedition.rms.RecordFilter loadFilter
RecordFilter
for data loading
public boolean loadKeepUpdated
keepUpdated
flag for data loading
public javax.microedition.rms.RecordStore recordStore
RecordStore
for storing table data
public RecordStructure structure
RecordStructure
for the current Record
Constructor Detail |
---|
public Table(java.lang.String name, boolean create)
Table
class and opens data store
name
- the MIDlet suite unique name for the table, not to exceed 32 characterscreate
- if true, the record store will be created if necessary.Method Detail |
---|
public int addRecord(Record rec)
INVALID_RECORD_ID
.
rec
- The Record
to be added
INVALID_RECORD_ID
.INVALID_RECORD_ID
,
open(java.lang.String, boolean)
,
Record
public boolean close()
Table
class.
Record structure and other table related information continue to be valid.
You can reopen data storage by calling method open
true
if operation was successful, false
otherwiseopen(String, boolean)
public static boolean delete(java.lang.String name)
name
- Name the MIDlet suite unique name for the table, not to exceed 32 characters
true
if operation was successful, false
otherwisepublic boolean deleteRecord(int id)
false
.
id
- The id of the record to use in this operation.
true
if deletion was successful, false
otherwiseRecord
public int getNumRecords()
-1
.
isOpen
,
open(java.lang.String, boolean)
public boolean load()
true
if operation was successful, false
otherwisepublic boolean open(java.lang.String name, boolean create)
name
- the MIDlet suite unique name for the table, not to exceed 32 characterscreate
- if true, the record store will be created if necessary.
true
if operation was successful, false
otherwisepublic abstract boolean processRecord(byte[] data, int recId)
Table
data
- The binary data representing record used in this operationrecId
- The id of the record to use in this operation.
true
if record processing should continue,
false
if record processing should be stoppedpublic boolean setRecord(int id, Record rec)
false
.
id
- The id of the record to use in this operation.rec
- The Record
to be set
true
if update was successful, false
otherwiseaddRecord(Record)
,
Record
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |