public class SimpleIndex extends Object implements Index
The file, start and ID are explicitly maintained as immutable properties of the index. This implementation should be appropriate for many indexing schemes. However, some schemes may wish to implement this interface as a wrapper around a simple file offset, or an array index.
Constructor and Description |
---|
SimpleIndex(File file,
long start,
int length,
String id)
Build the index using the given file, start and id
|
Modifier and Type | Method and Description |
---|---|
File |
getFile()
The file to retrieve from.
|
String |
getID()
The ID of the sequence at this position in this file.
|
int |
getLength()
The entry can be slurped out of the file by grabbing length bytes from
start.
|
long |
getStart()
Skipping this number of bytes through the file should put the file pointer
to the first byte of the sequence.
|
public SimpleIndex(File file, long start, int length, String id)
file
- the File this sequence is instart
- how many bytes to skip to reach the first byte of the sequencelength
- how many bytes can be pulled out of the file to grab the recordid
- the ID of the sequencepublic long getStart()
Index
public int getLength()
Index
Copyright © 2014 BioJava. All rights reserved.