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, removeRangeaddAll, remove, removeAll, retainAll, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, addAll, clear, equals, hashCode, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, sort, spliteratorparallelStream, removeIf, streamprotected 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
IOExceptionprotected T readRecordASCII(Scanner br) throws IOException
IOExceptionpublic 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)
RandomisableListrandomSubList in interface RandomisableList<T extends Readable>nelem - number of elements to extract