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.AbstractTupleListIterator
TupleList.PositionCallback
arity, mutable
modCount
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, tupleIterator
add, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public Member get(int slice, int index)
TupleList
Note 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 TupleList
get
in class AbstractTupleList
slice
- 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)
TupleList
The 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)
TupleList
If 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 AbstractTupleList
public 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 © 2018 Hitachi Vantara. All rights reserved.