edu.stanford.nlp.dbm
Class PersistentHashList
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--edu.stanford.nlp.dbm.PersistentHashList
- All Implemented Interfaces:
- Collection, List
- public class PersistentHashList
- extends AbstractList
Persistent List backed by a SimpleDatabase
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList |
PersistentHashList
public PersistentHashList(SimpleDatabase db)
- Creates a new PersistentHashList backed by
db
PersistentHashList
public PersistentHashList(String filename)
throws IOException
- Creates a new PersistentHashList backed by an SLJDB with filename
filename
.db.
set
public Object set(int index,
Object value)
- Specified by:
set
in interface List
- Overrides:
set
in class AbstractList
get
public Object get(int index)
- Specified by:
get
in interface List
- Specified by:
get
in class AbstractList
remove
public Object remove(int index)
- Specified by:
remove
in interface List
- Overrides:
remove
in class AbstractList
size
public int size()
- Returns the number of elements in this collection. If the collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE. Note: This is a slow implementation; it iterates through entire collection, and counts the number of elements.
- Specified by:
size
in interface List
- Specified by:
size
in class AbstractCollection
Stanford NLP Group