T - The type of BaseEntity the list will contain.public abstract class StreamBaseList<T extends BaseEntity> extends Object
Delegate methods are used to create new instances of items to add to the list in order to avoid creating many inherited list classes for each BaseEntity type.
Should not be referenced directly.
Objects of this class should not be created directly as they are part of the internal logic.
| Modifier and Type | Field and Description |
|---|---|
protected Dataset |
dataSet
The dataset which contains the list.
|
protected Header |
header
Information about the data structure the list is associated with.
|
| Constructor and Description |
|---|
StreamBaseList(Dataset dataSet,
BinaryReader reader,
BaseEntityFactory<T> entityFactory)
Constructs a new instance of BaseList of type T ready to read
entities from the source.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
createEntity(int key,
BinaryReader reader)
Used to create a new entity of type T when an item is required from the
list.
|
T |
get(int key)
Retrieves the record at the offset or index requested.
|
int |
size()
Returns The number of items in the list.
|
protected final Dataset dataSet
protected final Header header
public StreamBaseList(Dataset dataSet, BinaryReader reader, BaseEntityFactory<T> entityFactory)
dataSet - Dataset being created.reader - Reader used to initialise the header only.entityFactory - a base entity factory to be used.protected abstract T createEntity(int key, BinaryReader reader) throws IOException
key - The offset position in the data structure to the entity to
be returned from the list, or the index of the entity to be returned
from the list.reader - Reader connected to the source data structure and
positioned to start reading.IOException - if there was a problem accessing data file.public T get(int key) throws IOException
key - Index or offset of the record required.IOException - if there was a problem accessing data file.public int size()
Copyright © 2015 51Degrees. All rights reserved.