|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<BigHash>
org.tranche.hash.DiskBackedBigHashList
public class DiskBackedBigHashList
A list that stores BigHash objects. This is a memory-friendly method that commits portions of list to disk.
Every certain number of BigHash records, records are committed to disk, and the number of BigHash entries in memory are always less than the number of records stored in each partition file.
You can find out number of records stored per partition by calling static method DiskBackedBigHashList.RECORDS_PER_PARTITION().
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
DiskBackedBigHashList()
|
|
| Method Summary | |
|---|---|
boolean |
add(BigHash hash)
Append hash to list. |
void |
close()
|
boolean |
contains(BigHash hash)
Returns true if this contains a given Hash |
void |
destroy()
Deprecated. Use close |
java.io.File |
directory()
Returns directory that holds partition files |
protected void |
finalize()
When done with list, destroy records on disk. |
BigHash |
get(int index)
Get BigHash at specified index. |
static int |
getRecordsPerPartition()
Retrieve number of records per partition. |
java.util.Iterator<BigHash> |
iterator()
Returns an iterator for list. |
int |
paritionsOnDisk()
Returns number of partitions on disk. |
boolean |
recordOnDisk(int index)
Returns true if on disk, else returns false. |
int |
recordsInMemory()
Returns number of records in memory. |
int |
recordsOnDisk()
Returns number of records in partitions on disk. |
static int |
recordsPerPartition()
Returns number of BigHash entries stored in each disk partition. |
BigHash |
remove(int index)
CURRENTLY UNIMPLEMENTED |
static void |
setRecordsPerPartition(int aRECORDS_PER_PARTITION)
Set number of records per partition. |
int |
size()
Returns size of list. |
| Methods inherited from class java.util.AbstractList |
|---|
add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange, set, 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, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public DiskBackedBigHashList()
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void close()
public void destroy()
public static int recordsPerPartition()
public java.io.File directory()
public int size()
size in interface java.util.Collection<BigHash>size in interface java.util.List<BigHash>size in class java.util.AbstractCollection<BigHash>public int recordsInMemory()
public int recordsOnDisk()
public int paritionsOnDisk()
public boolean contains(BigHash hash)
hash - BigHash
public boolean add(BigHash hash)
add in interface java.util.Collection<BigHash>add in interface java.util.List<BigHash>add in class java.util.AbstractList<BigHash>hash - A BigHash to add to list.public BigHash get(int index)
get in interface java.util.List<BigHash>get in class java.util.AbstractList<BigHash>index - Index of BigHash.
public boolean recordOnDisk(int index)
index - Index of hash
public BigHash remove(int index)
remove in interface java.util.List<BigHash>remove in class java.util.AbstractList<BigHash>index - Index of BigHash.
public java.util.Iterator<BigHash> iterator()
Returns an iterator for list.
iterator in interface java.lang.Iterable<BigHash>iterator in interface java.util.Collection<BigHash>iterator in interface java.util.List<BigHash>iterator in class java.util.AbstractList<BigHash>public static int getRecordsPerPartition()
public static void setRecordsPerPartition(int aRECORDS_PER_PARTITION)
aRECORDS_PER_PARTITION -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||