public class FlatFile extends Object
Constructor and Description |
---|
FlatFile() |
FlatFile(File parent,
String child) |
FlatFile(String path) |
Modifier and Type | Method and Description |
---|---|
long |
findKeyOffset(RandomAccessFile fh,
String key)
Binary search thru RandomAccessFile argument to locate the first line
prefixed by key argument.
|
long |
findKeyOffsetLT(RandomAccessFile fh,
String key) |
long |
getLastMatchOffset() |
String |
getPath() |
org.archive.util.iterator.CloseableIterator<String> |
getRecordIterator(String prefix) |
org.archive.util.iterator.CloseableIterator<String> |
getRecordIteratorLT(String prefix) |
ReverseRecordIterator |
getReverseRecordIterator(String prefix) |
org.archive.util.iterator.CloseableIterator<String> |
getSequentialIterator() |
static void |
main(String[] args) |
void |
setPath(String path) |
void |
store(Iterator<String> itr) |
protected File file
public FlatFile()
public FlatFile(String path)
path
- public void setPath(String path)
path
- to setpublic String getPath()
public long findKeyOffset(RandomAccessFile fh, String key) throws IOException
fh
- key
- IOException
public long findKeyOffsetLT(RandomAccessFile fh, String key) throws IOException
IOException
public long getLastMatchOffset()
public org.archive.util.iterator.CloseableIterator<String> getSequentialIterator() throws IOException
IOException
public org.archive.util.iterator.CloseableIterator<String> getRecordIterator(String prefix) throws IOException
prefix
- IOException
public org.archive.util.iterator.CloseableIterator<String> getRecordIteratorLT(String prefix) throws IOException
IOException
public ReverseRecordIterator getReverseRecordIterator(String prefix) throws IOException
prefix
- IOException
public void store(Iterator<String> itr) throws IOException
IOException
public static void main(String[] args)
args
- Copyright © 2005–2015 IIPC. All rights reserved.