|
||||||||||
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<V>
org.terrier.structures.collections.FSArrayFile<V>
V
- Type of Writablepublic class FSArrayFile<V extends org.apache.hadoop.io.Writable>
A file for accessing Writable classes written on disk. These must be of fixed size. This implementation is read-only, but does implement the List interface.
Nested Class Summary | |
---|---|
static class |
FSArrayFile.ArrayFileIterator<V extends org.apache.hadoop.io.Writable>
ArrayFileIterator class |
static interface |
FSArrayFile.ArrayFileWriter
interface ArrayFileWriter |
Field Summary | |
---|---|
protected RandomDataInput |
dataFile
actual underlying data file |
protected String |
dataFilename
filename of the underlying file |
protected int |
entrySize
total size of one key,value pair |
protected int |
numberOfEntries
The number of entries in the file. |
static String |
USUAL_EXTENSION
USUAL_EXTENSION |
protected FixedSizeWriteableFactory<V> |
valueFactory
|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
protected |
FSArrayFile()
|
|
FSArrayFile(Index index,
String structureName)
constructor |
|
FSArrayFile(String filename,
boolean updateable,
FixedSizeWriteableFactory<V> _valueFactory)
default constructor |
Method Summary | |
---|---|
void |
close()
|
V |
get(int entryNumber)
|
Iterator<V> |
iterator()
|
int |
size()
|
static FSArrayFile.ArrayFileWriter |
writeFSArrayFile(String filename)
writeFSArrayFile |
Methods inherited from class java.util.AbstractList |
---|
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, 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, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
public static final String USUAL_EXTENSION
protected FixedSizeWriteableFactory<V extends org.apache.hadoop.io.Writable> valueFactory
protected int numberOfEntries
protected int entrySize
protected RandomDataInput dataFile
protected String dataFilename
Constructor Detail |
---|
protected FSArrayFile()
public FSArrayFile(Index index, String structureName) throws IOException
index
- structureName
-
IOException
public FSArrayFile(String filename, boolean updateable, FixedSizeWriteableFactory<V> _valueFactory) throws IOException
filename
- updateable
- _valueFactory
-
IOException
Method Detail |
---|
public int size()
size
in interface Collection<V extends org.apache.hadoop.io.Writable>
size
in interface List<V extends org.apache.hadoop.io.Writable>
size
in class AbstractCollection<V extends org.apache.hadoop.io.Writable>
public V get(int entryNumber)
get
in interface List<V extends org.apache.hadoop.io.Writable>
get
in class AbstractList<V extends org.apache.hadoop.io.Writable>
public Iterator<V> iterator()
iterator
in interface Iterable<V extends org.apache.hadoop.io.Writable>
iterator
in interface Collection<V extends org.apache.hadoop.io.Writable>
iterator
in interface List<V extends org.apache.hadoop.io.Writable>
iterator
in class AbstractList<V extends org.apache.hadoop.io.Writable>
public static FSArrayFile.ArrayFileWriter writeFSArrayFile(String filename) throws IOException
filename
-
IOException
public void close() throws IOException
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |