T
- the type of readable item held in arraypublic abstract class AbstractFileBackedList<T extends Readable> extends AbstractList<T> implements RandomisableList<T>, Cloneable
Modifier and Type | Field and Description |
---|---|
protected String |
charset |
protected Class<T> |
clz |
protected File |
file |
protected int |
headerLength |
protected boolean |
isBinary |
protected int |
recordLength |
protected int |
size |
modCount
Modifier | Constructor and Description |
---|---|
protected |
AbstractFileBackedList(int size,
boolean isBinary,
int headerLength,
int recordLength,
File file,
Class<T> clz) |
protected |
AbstractFileBackedList(int size,
boolean isBinary,
int headerLength,
int recordLength,
File file,
Class<T> clz,
String charset) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
T |
get(int index) |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object o) |
protected T |
newElementInstance()
Override this if your instances can't be constructed with a no-args
constructor
|
protected abstract AbstractFileBackedList<T> |
newInstance(int newSize,
boolean isBinary,
int newHeaderLength,
int recordLength,
File file) |
RandomisableList<T> |
randomSubList(int nelem)
Extract a sublist made up of nelem elements from the this list.
|
protected T |
readRecord(DataInput input) |
protected T |
readRecordASCII(Scanner br) |
T |
set(int index,
T element) |
int |
size() |
RandomisableList<T> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
add, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRange
addAll, remove, removeAll, retainAll, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, addAll, clear, equals, hashCode, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, sort, spliterator
parallelStream, removeIf, stream
protected final int size
protected final boolean isBinary
protected final int headerLength
protected final int recordLength
protected AbstractFileBackedList(int size, boolean isBinary, int headerLength, int recordLength, File file, Class<T> clz)
protected AbstractFileBackedList(int size, boolean isBinary, int headerLength, int recordLength, File file, Class<T> clz, String charset)
protected T newElementInstance()
protected T readRecord(DataInput input) throws IOException
IOException
protected T readRecordASCII(Scanner br) throws IOException
IOException
public int size()
public boolean isEmpty()
public <E> E[] toArray(E[] a)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T extends Readable>
containsAll
in interface List<T extends Readable>
containsAll
in class AbstractCollection<T extends Readable>
public int lastIndexOf(Object o)
lastIndexOf
in interface List<T extends Readable>
lastIndexOf
in class AbstractList<T extends Readable>
protected abstract AbstractFileBackedList<T> newInstance(int newSize, boolean isBinary, int newHeaderLength, int recordLength, File file)
public RandomisableList<T> subList(int fromIndex, int toIndex)
public RandomisableList<T> randomSubList(int nelem)
RandomisableList
randomSubList
in interface RandomisableList<T extends Readable>
nelem
- number of elements to extract