|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
An interface for a Document containing other documents. In addition to properties, a CollectionDocument contains by reference an arbitrary number of other documents. The document collection has the semantics of a set: a document is either present or absent but never appears more than once, and no ordering is preserved among the documents in the collection. For convenience, the CollectionDocument interface extends java.util.Set, although invoking any Set method with an object that is not a Document will cause a ClassCastException. The Set functionality should be used carefully and a CollectionDocument should not be passed to any code that expects a generic Set capable of containing any type of object. Bantam applications should typically use the type-specific CollectionDocument methods.
CollectionDocument membership may be specified by query (intensional) or explicit addition and removal of members (extensional) or by a combination of a query and explicit inclusion or exclusion of specific members. Note that query specification implies that the membership of the collection may change without any operation on the CollectionDocument itself.
| Method Summary | |
boolean |
add(Object obj)
Set method for explicitly adding documents with the same semantics as addDocument. |
boolean |
addAll(Collection col)
Set method for explicitly adding a number of documents with the same net effect as invoking addDocument on each individually. |
boolean |
addDocument(Document doc)
Add the specified document. |
boolean |
addDocument(String id)
Version of addDocument that takes an ID rather than a Document object. |
void |
clear()
Clear collection membership. |
void |
clearQuery()
Clear the query associated with the collection. |
boolean |
contains(Object obj)
Set method for testing for presence of a particular document. |
boolean |
containsAll(Collection col)
Set method for testing for presence of particular documents. |
boolean |
containsDocument(Document doc)
Returns true if the collection contains the specified document. |
boolean |
containsDocument(String id)
Returns true if the collection contains the document specified by its ID. |
boolean |
equals(Object col)
Should return true IFF the target collection is of the same class, shares the same Storage() object, and represents the same entity in the Storage repository. |
DocumentList |
getDocuments()
Return all of the documents contained in the collection. |
Query |
getQuery()
Returns the query associated with the collection. |
int |
hashCode()
Returns an implementation-dependent hash code. |
boolean |
isEmpty()
Returns true if the collection contains no members. |
Iterator |
iterator()
Return a set-style iterator over the collection. |
boolean |
remove(Object obj)
Set method for explicitly removing documents with the same semantics as removeDocument. |
boolean |
removeAll(Collection col)
Set method for explicitly removing documents with the same semantics as removeDocuments. |
boolean |
removeDocument(Document doc)
Remove the specified document. |
boolean |
removeDocument(String id)
Version of removeDocument that takes an ID rather than a Document object. |
boolean |
removeDocuments(Collection c)
Remove all the specified documents. |
void |
reset()
Reverse all explicit addition and removal operations so that the membership is reset to the set of documents matching the query. |
boolean |
retainAll(Collection col)
Set method for explicitly removing documents with the same semantics as removeDocuments. |
void |
setQuery(Query query)
Sets the query associated with the collection. |
int |
size()
Returns the number of elements in the collection. |
Object[] |
toArray()
Returns an array of Document objects. |
Object[] |
toArray(Object[] a)
|
| Methods inherited from interface com.xerox.bantam.Document |
addMultiValue, addMultiValue, clearProperty, clearProperty, conformsTo, containsValue, containsValue, delete, enforceSchema, enforceSchema, flush, get_all_property_names, getDescriptors, getEnforcedSchemas, getID, getMultiValues, getMultiValues, getName, getPropertyNames, getPropertyNames, getPropertyValue, getPropertyValue, getStorage, getUnenforcedPropertyNames, isEnforced, propertyExists, propertyExists, removeValue, removeValue, setMultiValues, setMultiValues, setName, setPropertyValue, setPropertyValue, unenforceSchema |
| Method Detail |
public DocumentList getDocuments()
throws StorageException
public boolean addDocument(Document doc)
throws StorageException
doc - the Document to be explicitly a member of the collection
public boolean addDocument(String id)
throws StorageException
id - the id of the Document to be explicitly a member of the collection.
public boolean removeDocument(Document doc)
throws StorageException
doc - the Document to be explicitly excluded from the collection.
public boolean removeDocument(String id)
throws StorageException
id - the id of the Document to be explicitly excluded from the collection.
public boolean removeDocuments(Collection c)
throws StorageException
c - Collection of Document objects for documents to be removed
public boolean containsDocument(Document doc)
throws StorageException
public boolean containsDocument(String id)
throws StorageException
public void setQuery(Query query)
throws StorageException
public Query getQuery()
throws StorageException
public void clearQuery()
throws StorageException
public void reset()
throws StorageException
public boolean equals(Object col)
equals in interface Setequals in class Objectpublic int hashCode()
hashCode in interface SethashCode in class Objectpublic int size()
size in interface Setpublic boolean add(Object obj)
add in interface Setobj - a Document object for the document to be addedClassCastException - if obj is not an instance of Documentpublic boolean addAll(Collection col)
addAll in interface Setcol - a collection of Document objects for the documents to be addedClassCastException - if col contains an object that is not an instance of Documentpublic void clear()
clear in interface Setpublic boolean remove(Object obj)
remove in interface Setobj - a Document object for the document to be removedClassCastException - if obj is not an instance of Documentpublic boolean removeAll(Collection col)
removeAll in interface Setcol - a collection of Document objects for the documents to be removedClassCastException - if col contains an object that is not an instance of Documentpublic boolean retainAll(Collection col)
retainAll in interface Setcol - a collection of Document objects for the member documentsClassCastException - if col contains an object that is not an instance of Documentpublic boolean contains(Object obj)
contains in interface Setobj - a Document object for the document to testClassCastException - if obj is not a Document objectpublic boolean containsAll(Collection col)
containsAll in interface Setcol - a Collection of Document objects for documents to be testedClassCastException - if col contains an object that is not an instance of Documentpublic boolean isEmpty()
isEmpty in interface Setpublic Object[] toArray()
toArray in interface Setpublic Object[] toArray(Object[] a)
toArray in interface Setpublic Iterator iterator()
iterator in interface Set
|
Project Harland | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||