T - the type of local featurepublic class StreamLocalFeatureList<T extends LocalFeature<?,?>> extends AbstractStreamBackedList<T> implements LocalFeatureList<T>
LocalFeatures backed by an input stream. The list is
read-only, and can only be read in order (i.e. random access is not
possible).clz, consumed, headerLength, isBinary, recordLength, sizemodCountBINARY_HEADER| Modifier | Constructor and Description |
|---|---|
protected |
StreamLocalFeatureList(InputStream stream,
int size,
boolean isBinary,
int headerLength,
int recordLength,
int veclen,
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 id your instances can't be constructed with a no-args ctr
|
static <T extends LocalFeature<?,?>> |
read(BufferedInputStream stream,
Class<T> clz)
Construct a new StreamLocalFeatureList from the given input stream.
|
static <T extends LocalFeature<?,?>> |
read(InputStream stream,
Class<T> clz)
Construct a new StreamLocalFeatureList from the given input stream.
|
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.
|
consumed, listIterator, randomSubList, readRecord, readRecordASCII, remaining, sizeadd, addAll, get, iterator, remove, setadd, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRangeaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, 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 StreamLocalFeatureList(InputStream stream, int size, boolean isBinary, int headerLength, int recordLength, int veclen, Class<T> clz)
public static <T extends LocalFeature<?,?>> StreamLocalFeatureList<T> read(InputStream stream, Class<T> clz) throws IOException
T - the type of local featurestream - the input streamclz - the class of local feature to readIOException - if an error occurs reading from the streampublic static <T extends LocalFeature<?,?>> StreamLocalFeatureList<T> read(BufferedInputStream stream, Class<T> clz) throws IOException
T - the type of local featurestream - the input streamclz - the class of local feature to readIOException - if an error occurs reading from the streampublic <Q> Q[] asDataArray(Q[] a)
LocalFeatureListasDataArray in interface LocalFeatureList<T extends LocalFeature<?,?>>Q - the data typea - the array to fillpublic 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 WriteableASCIIprotected T newElementInstance()
AbstractStreamBackedListnewElementInstance in class AbstractStreamBackedList<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 AbstractList<T extends LocalFeature<?,?>>