public class ListTupleList extends AbstractTupleList
TupleList that stores tuples
end-to-end in a backing list.
l1: {A,B,C},{D,E,F}
l2: {a,b},{c,d},{e,f}
externally looks like:
[] <- {A,B,C,a,b}
[] <- {A,B,C,c,d}
[] <- {A,B,C,e,f}
[] <- {D,E,F,a,b}
[] <- {D,E,F,c,d}
[] <- {D,E,F,e,d}
but internally is:
A,B,C,a,b,A,B,C,c,d,A,B,C,e,f,D,E,F,a,b,D,E,F,c,d,D,E,F,e,d
AbstractTupleList.AbstractTupleListIteratorTupleList.PositionCallbackarity, mutablemodCount| Constructor and Description |
|---|
ListTupleList(int arity,
List<Member> list)
Creates a ListTupleList.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
List<Member> element) |
boolean |
addAll(Collection<? extends List<Member>> c) |
boolean |
addAll(int i,
Collection<? extends List<Member>> c) |
void |
addTuple(Member... members) |
protected List<Member> |
backingList() |
void |
clear() |
TupleList |
cloneList(int capacity)
Creates a copy of this list that has the same type and has a given
capacity.
|
List<Member> |
get(int index) |
Member |
get(int slice,
int index)
Returns a particular column of a particular row.
|
TupleList |
project(int[] destIndices) |
List<Member> |
remove(int index) |
protected void |
removeRange(int fromIndex,
int toIndex) |
List<Member> |
set(int index,
List<Member> element) |
int |
size() |
List<Member> |
slice(int column)
Returns a list of the members at a given column.
|
TupleList |
subList(int fromIndex,
int toIndex) |
TupleIterator |
tupleIteratorInternal() |
TupleList |
withPositionCallback(TupleList.PositionCallback positionCallback) |
addCurrent, fix, getArity, iterator, tupleCursor, tupleIteratoradd, equals, hashCode, indexOf, lastIndexOf, listIterator, listIteratorcontains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic Member get(int slice, int index)
TupleListNote that list.get(row, column)
is equivalent to list.slice(column).get(row)
and list.get(row).get(column)
but is more efficient for most implementations of TupleList.
get in interface TupleListget in class AbstractTupleListslice - Column ordinalindex - Row ordinalpublic void addTuple(Member... members)
public void clear()
protected void removeRange(int fromIndex,
int toIndex)
removeRange in class AbstractList<List<Member>>public int size()
public List<Member> slice(int column)
TupleListThe list is modifiable if and only if this TupleList is modifiable. Adding an element to a slice will create a tuple whose members in other columns are null. Removing an element from a slicer will remove a tuple.
column - Ordinal of the member in each tuple to projectpublic TupleList cloneList(int capacity)
TupleListIf capacity is negative, populates the list. A deep copy is made, so that it the contents of the list are not affected to changes to any backing collections.
capacity - Capacitypublic TupleIterator tupleIteratorInternal()
tupleIteratorInternal in class AbstractTupleListpublic TupleList project(int[] destIndices)
public boolean addAll(Collection<? extends List<Member>> c)
public boolean addAll(int i,
Collection<? extends List<Member>> c)
public TupleList subList(int fromIndex, int toIndex)
public TupleList withPositionCallback(TupleList.PositionCallback positionCallback)
Copyright © 2021 Hitachi Vantara. All rights reserved.