com.xerox.bantam.util
Class DocumentListImpl
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.ArrayList
|
+--com.xerox.bantam.util.DocumentListImpl
- All Implemented Interfaces:
- Cloneable, Collection, DocumentList, List, Serializable
- public class DocumentListImpl
- extends ArrayList
- implements DocumentList
An internal Document container (like ArrayList, only with some
strong typing).
- Version:
- $Revision: 1.1 $, $Date: 2000/02/19 02:48:25 $
- Author:
- Keith Edwards
- See Also:
- Serialized Form
| Methods inherited from class java.util.ArrayList |
addAll, clear, clone, ensureCapacity, get, isEmpty, remove, removeRange, size, toArray, toArray, trimToSize |
| Methods inherited from interface java.util.List |
addAll, clear, containsAll, equals, get, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, removeAll, retainAll, size, subList, toArray, toArray |
DocumentListImpl
public DocumentListImpl()
DocumentListImpl
public DocumentListImpl(int size)
DocumentListImpl
public DocumentListImpl(Collection col)
getDocument
public Document getDocument(int index)
- Description copied from interface:
DocumentList
- Get the document at a specific position
- Specified by:
getDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
index - the index of the document to return- Returns:
- the document at the specified position in this list
containsDocument
public boolean containsDocument(Document item)
- Description copied from interface:
DocumentList
- Returns true if the list contains the specified document
- Specified by:
containsDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
item - - the document whose presence is to be tested.true - iff the specified document is contained in the list
indexOfDocument
public int indexOfDocument(Document doc)
- Description copied from interface:
DocumentList
- Returns the index in this list of the first occurrence of the specified document,
or -1 if this list does not contain this document.
- Specified by:
indexOfDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
doc - - the document to find- Returns:
- the index of the first occurrence or -1
lastIndexOfDocument
public int lastIndexOfDocument(Document doc)
- Description copied from interface:
DocumentList
- Returns the index in this list of the last occurrence of the specified document,
or -1 if this list does not contain this document
- Specified by:
lastIndexOfDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
doc - - the document to find- Returns:
- the index of the last occurrence or -1
setDocument
public void setDocument(int index,
Document doc)
- Description copied from interface:
DocumentList
- Replaces the document at the specified position with the supplied document.
- Specified by:
setDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
index - - index of the document to replacedoc - - the replacement document
addDocument
public void addDocument(int index,
Document doc)
- Description copied from interface:
DocumentList
- Inserts the specified document at the specified position
- Specified by:
addDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
index - - the insertion positiondoc - - the document to insert
addDocument
public void addDocument(Document doc)
- Description copied from interface:
DocumentList
- Appends the specified document to the end of the list
- Specified by:
addDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
doc - - the document to append
addDocuments
public void addDocuments(DocumentList dl)
- Description copied from interface:
DocumentList
- Appends all of the documents in the supplied list to the end of this list,
in their original order.
- Specified by:
addDocuments in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
dl - - list of documents to be appended
removeDocument
public boolean removeDocument(Document doc)
- Description copied from interface:
DocumentList
- Removes the first occurrence of the specified document, if present
- Specified by:
removeDocument in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
doc - - the document to remove- Returns:
- true if the list contained the document
removeAllDocuments
public boolean removeAllDocuments(Document doc)
- Description copied from interface:
DocumentList
- Removes all occurrences of the specified document, if present
- Specified by:
removeAllDocuments in interface DocumentList
- Following copied from interface:
com.xerox.bantam.DocumentList
- Parameters:
doc - - the document to remove- Returns:
- true if the list contained the document
add
public void add(int index,
Object elem)
- Specified by:
add in interface List- Overrides:
add in class ArrayList
add
public boolean add(Object elem)
- Specified by:
add in interface List- Overrides:
add in class ArrayList
addAll
public boolean addAll(Collection c)
- Specified by:
addAll in interface List- Overrides:
addAll in class ArrayList
contains
public boolean contains(Object elem)
- Specified by:
contains in interface List- Overrides:
contains in class ArrayList
indexOf
public int indexOf(Object elem)
- Specified by:
indexOf in interface List- Overrides:
indexOf in class ArrayList
lastIndexOf
public int lastIndexOf(Object elem)
- Specified by:
lastIndexOf in interface List- Overrides:
lastIndexOf in class ArrayList
set
public Object set(int index,
Object elem)
- Specified by:
set in interface List- Overrides:
set in class ArrayList
deleteAll
public void deleteAll()
throws StorageException