T
- the type of local featurepublic class FileLocalFeatureList<T extends LocalFeature<?,?>> extends AbstractFileBackedList<T> implements LocalFeatureList<T>, Cloneable
LocalFeatureList
backed by a file. Data is only read as necessary.Modifier and Type | Field and Description |
---|---|
protected int |
veclen |
charset, clz, file, headerLength, isBinary, recordLength, size
modCount
BINARY_HEADER
Modifier | Constructor and Description |
---|---|
protected |
FileLocalFeatureList(int size,
int veclen,
boolean isBinary,
int headerLength,
int recordLength,
File file,
Class<T> clz) |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii output.
|
<Q> Q[] |
asDataArray(Q[] a)
Get the feature-vector data of the list as a two-dimensional array of
data.
|
byte[] |
binaryHeader()
Header for binary output.
|
protected T |
newElementInstance()
Override this if your instances can't be constructed with a no-args
constructor
|
protected AbstractFileBackedList<T> |
newInstance(int newSize,
boolean isBinary,
int newHeaderLength,
int recordLength,
File file) |
static <T extends LocalFeature<?,?>> |
read(File keypointFile,
Class<T> clz)
Read a file containing a set of local features of a type clz.
|
MemoryLocalFeatureList<T> |
subList(int fromIndex,
int toIndex) |
int |
vecLength()
Get the length of the feature-vectors of each local feature if they are
constant.
|
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
add, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, randomSubList, readRecord, readRecordASCII, set, size, toArray, toArray
add, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRange
addAll, remove, removeAll, retainAll, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
randomSubList
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected final int veclen
protected FileLocalFeatureList(int size, int veclen, boolean isBinary, int headerLength, int recordLength, File file, Class<T> clz)
public static <T extends LocalFeature<?,?>> FileLocalFeatureList<T> read(File keypointFile, Class<T> clz) throws IOException
T
- the local feature classkeypointFile
- the fileclz
- the local feature classIOException
- if a problem occurs reading the filepublic int vecLength()
LocalFeatureList
vecLength
in interface LocalFeatureList<T extends LocalFeature<?,?>>
public void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to outpublic byte[] binaryHeader()
WriteableBinary
binaryHeader
in interface WriteableBinary
public String asciiHeader()
WriteableASCII
asciiHeader
in interface WriteableASCII
public <Q> Q[] asDataArray(Q[] a)
LocalFeatureList
asDataArray
in interface LocalFeatureList<T extends LocalFeature<?,?>>
Q
- the data typea
- the array to fillprotected AbstractFileBackedList<T> newInstance(int newSize, boolean isBinary, int newHeaderLength, int recordLength, File file)
newInstance
in class AbstractFileBackedList<T extends LocalFeature<?,?>>
protected T newElementInstance()
AbstractFileBackedList
newElementInstance
in class AbstractFileBackedList<T extends LocalFeature<?,?>>
public MemoryLocalFeatureList<T> subList(int fromIndex, int toIndex)
subList
in interface List<T extends LocalFeature<?,?>>
subList
in interface LocalFeatureList<T extends LocalFeature<?,?>>
subList
in class AbstractFileBackedList<T extends LocalFeature<?,?>>