T - The type the list will contain.public abstract class MemoryBaseList<T extends BaseEntity> extends Object implements IReadonlyList<T>, Closeable
This class provides base functions for lists implemented in memory using arrays of type T. List extended by other lists in this package.
Interfaces are used to create new instances of items to add to the list in order to avoid creating many inherited list classes for each type.
The data is held in the private variable array.
Objects of this class should not be created directly as they are part of the internal logic.
| Modifier and Type | Field and Description |
|---|---|
protected List<T> |
array
Array of items contained in the list.
|
protected Dataset |
dataSet
The dataset which contains the list.
|
protected BaseEntityFactory<T> |
entityFactory
Interface used to create a new instance of an item in the list.
|
Header |
header
Information about the data structure the list is associated with.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Dispose of any items the list holds open.
|
Iterator<T> |
iterator()
Returns An iterator to the array of items.
|
abstract void |
read(BinaryReader reader)
Reads all the records to be added to the list.
|
int |
size()
Returns The number of entities the list contains.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetforEach, spliteratorprotected final List<T extends BaseEntity> array
protected final Dataset dataSet
protected final BaseEntityFactory<T extends BaseEntity> entityFactory
public final Header header
public void close()
close in interface Closeableclose in interface AutoCloseablepublic Iterator<T> iterator()
iterator in interface Iterable<T extends BaseEntity>public int size()
size in interface IReadonlyList<T extends BaseEntity>public abstract void read(BinaryReader reader) throws IOException
reader - Reader connected to the source data structure and
positioned to start reading.IOException - if there was a problem accessing data file.Copyright © 2015 51Degrees. All rights reserved.