T - The type of BaseEntity the list will contain.public class StreamVariableList<T extends BaseEntity> extends StreamCacheList<T> implements IReadonlyList<T>
Entities in the underlying data structure are either fixed length where the data that represents them always contains the same number of bytes, or variable length where the number of bytes to represent the entity varies.
This class uses the offset of the first byte of the entities data in the underlying data structure in the accessor. As such the list isn't being used as a traditional list because items are not retrieved by their index in the list, but by there offset in the underlying data structure.
The constructor will read the header information about the underlying data structure. The data for each entity is only loaded when requested via the accessor. A cache is used to avoid creating duplicate objects when requested multiple times.
Data sources which don't support seeking can not be used. Specifically compressed data structures can not be used with these lists.
Objects of this class should not be created directly as they are part of the internal logic.
dataSet, header| Constructor and Description |
|---|
StreamVariableList(Dataset dataSet,
BinaryReader reader,
BaseEntityFactory<T> entityFactory,
int cacheSize)
Constructs a new instance of VariableList of type T.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Not supported.
|
protected T |
createEntity(int offset,
BinaryReader reader)
Creates a new entity of type T.
|
Iterator<T> |
iterator() |
fetch, get, getPercentageMisses, getSwitches, resetCachesizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, sizeforEach, spliteratorpublic StreamVariableList(Dataset dataSet, BinaryReader reader, BaseEntityFactory<T> entityFactory, int cacheSize)
dataSet - The DetectorDataSet being created.reader - Reader connected to the source data structure and
positioned to start reading.entityFactory - Factory to build entities of type T.cacheSize - number of items in cache.protected T createEntity(int offset, BinaryReader reader) throws IOException
createEntity in class StreamBaseList<T extends BaseEntity>offset - The offset of the entity being created.reader - Reader connected to the source data structure and
positioned to start reading.IOException - if there was a problem accessing data file.public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2015 51Degrees. All rights reserved.