It offers simple functions that are mainly called by FastObjectDB. The unique index that index collection object ids, must be added first.
Definition at line 55 of file FODBCollection.java.
Public Member Functions | |
FODBCollectionDescriptor | getDescriptor () |
Class | getCollectionObjectClass () |
FODBIndex | getIndexByMember (String member) |
boolean | isSynchronized () |
String | getName () |
void | setCollectionCypher (FODBCypher cypher) throws FODBException |
Init collection encryption with the specified cypher. | |
FODBCypher | getCollectionCypher () throws FODBException |
return the collection cypher if any, null otherwise. | |
boolean | addIndex (FODBIndexDescriptor descriptor) throws FODBException |
Add an index. | |
FODBIndex[] | getCollectionIndexList () |
FODBUniqueIndex | getCollectionIdIndex () throws FODBException |
boolean | addElement (Object obj) throws FODBException |
Add an Element to the collection. | |
boolean | replaceElement (Object obj) throws FODBException |
Replace an existing element of the Collection. | |
boolean | deleteSingleElement (Object obj) throws FODBException |
Delete an element of the Collection. | |
boolean | deleteObjectWithId (Object id) throws FODBException |
Delete an object of the Collection with its ID. | |
ForwardUniqueIndexIterator | getForwardIndexIterator (String memberName) throws FODBException |
BackwardUniqueIndexIterator | getBackwardIndexIterator (String memberName) throws FODBException |
Object | getElementAtPos (long pos) throws FODBException |
Returns the element at position 'pos'. | |
FastObjectDB | getDatabase () |
Static Public Member Functions | |
static FODBCollection | createCollection (FastObjectDB db, FODBCollectionDescriptor descriptor) throws FODBException |
Function that is called to create a new collection. | |
static FODBCollection | openCollection (FastObjectDB db, String colName) throws FODBException |
Function that is called to open an existing collection. | |
Protected Member Functions | |
Object | getNodeAtPos (long pos) throws FODBException |
Returns the node at position 'pos'. |
|
Add an Element to the collection.
Definition at line 270 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.common.util.collection.Array.size, and org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.writeObject(). Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.add(). |
|
Add an index.
Definition at line 214 of file FODBCollection.java. References org.openmobileis.common.util.collection.Array.add(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.contains(), and org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(). Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.addIndex(). |
|
Function that is called to create a new collection.
Definition at line 149 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.FODBCollectionDescriptor.getCollectionName(), org.openmobileis.database.fastobjectdb.FastObjectDB.getName(), and org.openmobileis.database.fastobjectdb.FastObjectDB.getRootDir(). Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.createCollection(). |
|
|
Delete an element of the Collection.
Definition at line 354 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.getKey(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), and org.openmobileis.common.util.collection.Array.isEmpty(). Referenced by org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDB.add(), org.openmobileis.database.fastobjectdb.FastObjectDB.delete(), and org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDB.replace(). |
|
return the collection cypher if any, null otherwise.
Definition at line 202 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.getCollectionCypher(). Referenced by org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDBManager.flushDB(), and org.openmobileis.database.fastobjectdb.synchro.client.OpenMSPFODBSyncListener.getSendCommandMetaData(). |
|
Definition at line 533 of file FODBCollection.java. Referenced by org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.BackwardUniqueIndexIterator(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.initCurrentNode(), org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.initCurrentNode(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.next(), and org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.prev(). |
|
Returns the element at position 'pos'.
Definition at line 501 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readObject(), and org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.validateThread(). Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.next(), and org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.prev(). |
|
Returns the node at position 'pos'.
Definition at line 520 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readNode(). Referenced by org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.BackwardUniqueIndexIterator(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.next(), and org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.prev(). |
|
Function that is called to open an existing collection.
Definition at line 170 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.FastObjectDB.getName(), and org.openmobileis.database.fastobjectdb.FastObjectDB.getRootDir(). Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.openCollection(). |
|
Replace an existing element of the Collection.
Definition at line 308 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.getKey(), org.openmobileis.database.fastobjectdb.db.index.FODBUniqueIndex.getKeyPosition(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.getType(), and org.openmobileis.common.util.collection.Array.isEmpty(). Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.replace(). |
|
Init collection encryption with the specified cypher. Must be call just after collection initialization before storing/reading any data. Same cypher must be provided to read already stored object.
Definition at line 193 of file FODBCollection.java. References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.setCollectionCypher(). Referenced by org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDBManager.getCurrentFODB(), and org.openmobileis.database.fastobjectdb.db.test.TestFastObjectDB.openDB(). |