|
JADE Java Persistence API 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jadeworld.jade.rootschema.Object
com.jadeworld.jade.rootschema.Collection<M>
public abstract class Collection<M>
The base class for all JADE collections. All collections of objects inherit from this class. JADE primitive arrays become ArrayLists of primitives.
This class implements the java.util.Collection interface, so that all JADE collections can be used as if they were Java collections, subject to some differences in the underlying implementations.
The JADE Collection class also implements extra methods to expose the additional JADE functionality.
| Field Summary |
|---|
| Fields inherited from class com.jadeworld.jade.rootschema.Object |
|---|
oid |
| Constructor Summary | |
|---|---|
Collection()
|
|
| Method Summary | |
|---|---|
boolean |
add(M element)
Adds the object specified in the element parameter to the collection. |
boolean |
addAll(java.util.Collection<? extends M> c)
Adds all of the items in the specified collection to this collection. |
void |
clear()
Removes all entries from this collection. |
boolean |
contains(java.lang.Object element)
Returns true if the collection contains the object specified in the element parameter. |
boolean |
containsAll(java.util.Collection<?> c)
Returns true if this collection already contains all items in the given collection. |
void |
copy(ByRef<Collection> toColl)
Copies entries from the receiver collection to a compatible collection passed as the toColl parameter. |
int |
countOf(java.lang.Object o)
Returns the number of times the entry specified in the parameter occurs in this collection. |
Iterator<M> |
createIterator()
Creates a heavyweight JADE iterator, which implements the java.util.Iterator interface. |
void |
deleteIfEmpty()
Deletes an empty shared or exclusive collection. |
M |
first()
Returns a reference to the first entry in this collection. |
java.lang.Object |
getOwner()
Returns a reference to the object that is the owner, or parent, of the collection. |
void |
getStatistics(ByRef<JadeDynamicObject> jdoRef)
Analyzes the collection and returns structural statistics in the attributes of a JadeDynamicObject, representing collection statistics. |
int |
indexOf(java.lang.Object o)
Returns the index of the entry specified in the parameter if it exists in the collection or it returns zero if it does not exist. |
void |
instantiate()
Ensures that the collection is created before it is used.. |
boolean |
isEmpty()
Returns true if there are no elements in the collection. |
java.util.Iterator<M> |
iterator()
Creates a lightweight JADE iterator, which implements the java.util.Iterator interface. |
M |
last()
Returns a reference to the last entry in this collection. |
int |
maxSize()
Returns the maximum number of entries that a collection can contain. |
void |
purge()
Deletes all objects in a collection and clears the collection; that is, size = 0. |
boolean |
remove(java.lang.Object element)
Removes an item from a collection. |
boolean |
removeAll(java.util.Collection<?> c)
Removes all of the items in the current collection that are also in the given collection. |
boolean |
retainAll(java.util.Collection c)
Retains all of the items in the current collection which are also in the specified collection. |
void |
setBlockSize(int blockSize)
Enables you to specify or change the block size of the receiver in terms of entries in each block. |
int |
size()
Returns the size of the collection. |
java.lang.Object[] |
toArray()
Returns an Object array containing all of this collection's items in the order specified by the collection iterator. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Not yet implemented |
java.lang.String |
toString()
Return the value when an object instance is displayed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Collection()
| Method Detail |
|---|
public java.lang.String toString()
toString in class Objectpublic Iterator<M> createIterator()
public java.util.Iterator<M> iterator()
iterator in interface java.lang.Iterable<M>iterator in interface java.util.Collection<M>public int size()
size in interface java.util.Collection<M>public boolean isEmpty()
isEmpty in interface java.util.Collection<M>public boolean contains(java.lang.Object element)
contains in interface java.util.Collection<M>element - The object to check for existence in the collection.
public boolean add(M element)
add in interface java.util.Collection<M>element - the object is to add to the collection
public boolean remove(java.lang.Object element)
remove in interface java.util.Collection<M>element - The object to remove from the collection.
public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<M>c - The collection whose items are to be checked against the current collection.
public boolean addAll(java.util.Collection<? extends M> c)
addAll in interface java.util.Collection<M>c - The collection whose items are to be added.
public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<M>c - The collection whose items are to be removed.
public boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Collection<M>c - The collection whose items are to be removed.
public void clear()
clear in interface java.util.Collection<M>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<M>public java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.Collection<M>public void copy(ByRef<Collection> toColl)
EntityAccess.createAsTransient(personArray);
personArray = collRef.get();
ByRef
JADE-only method.
toColl - The collection to which the contents of the current collection are to be copied..public int countOf(java.lang.Object o)
o - The object to search for.
public void deleteIfEmpty()
isEmpty() method to determine if a collection is empty.
Caution Although you can use this method with any exclusive collection, it un-instantiates
(deletes) the collection if it has no members. You should therefore take care to ensure that old
copies of the exclusive collection are not left in node caches.
If the collection is repopulated, it is instantiated starting with edition 1. This can match an old
copy in cache, which could then be regarded as current.
JADE-only method.
public M first()
public java.lang.Object getOwner()
public void getStatistics(ByRef<JadeDynamicObject> jdoRef)
The attributes of a collection statistics dynamic object are defined and interpreted as follows.
Attribute Description
blockSize Entries per block
keyLength Size of the key in bytes (oid (6) for Set classes and Integer (4) for Array classes)
entrySize Size of each collection entry in bytes
size Number of entries in the collection (that is, the size of the collection itself)
blockCount Total number of blocks in the collection
height Number of levels in the collection (always 1 for Array classes)
minEntries Minimum number of entries found in any block
maxEntries Maximum number of entries found in any block
avgEntries Average number of entries in collection blocks
loadFactor Actual average percent loading of collection blocks (entries for each block)
To compute the block size in bytes, multiply the blockSize attribute by the entrySize attribute. The maximum collection block size for a collection is 256K bytes
public int indexOf(java.lang.Object o)
o - The object to search for.
public void instantiate()
Note This method applies only to exclusive collections.
JADE-only method.
public M last()
public int maxSize()
public void purge()
Caution: The objects that are removed are physically deleted.
The purge operation ignores object not found exceptions, which enables you to fix manually maintained collections that have references to objects that are now deleted.
public void setBlockSize(int blockSize)
Note<.b> The time taken to reblock a collection increases with the collection size and could be quite lengthy for large collections. This reblock operation is similar to the type of upgrade that can occur during a reorganization, and the collection remains inaccessible until the process has completed.
|
JADE Java Persistence API 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||