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


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PersistentHashList(SimpleDatabase db)
          Creates a new PersistentHashList backed by db
PersistentHashList(String filename)
          Creates a new PersistentHashList backed by an SLJDB with filename filename.db.
 
Method Summary
 Object get(int index)
           
 Object remove(int index)
           
 Object set(int index, Object value)
           
 int size()
          Returns the number of elements in this collection.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

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.

Method Detail

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