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, sizemodCountBINARY_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, toArrayadd, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRangeaddAll, remove, removeAll, retainAll, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitrandomSubListadd, 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, toArrayparallelStream, removeIf, streamprotected 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()
LocalFeatureListvecLength in interface LocalFeatureList<T extends LocalFeature<?,?>>public void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinaryout - sink to write toIOException - an error writing to outpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIout - sink to write toIOException - an error writing to outpublic byte[] binaryHeader()
WriteableBinarybinaryHeader in interface WriteableBinarypublic String asciiHeader()
WriteableASCIIasciiHeader in interface WriteableASCIIpublic <Q> Q[] asDataArray(Q[] a)
LocalFeatureListasDataArray 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()
AbstractFileBackedListnewElementInstance 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<?,?>>