public class UnaryTupleList extends AbstractList<List<Member>> implements TupleList
TupleList
where the tuples are unary (each tuple
consists of just one Member
).
It is implemented as a straightforward wrapper on a backing list. You
can provide the backing list explicitly using the
UnaryTupleList(java.util.List)
constructor, and you can access the
backing list by calling slice(int)
(0).
TupleList.PositionCallback
modCount
Constructor and Description |
---|
UnaryTupleList()
Creates an empty UnaryTupleList.
|
UnaryTupleList(List<Member> list)
Creates a UnaryTupleList with a given backing list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
List<Member> element) |
boolean |
add(List<Member> element) |
void |
addCurrent(TupleCursor tupleIter) |
void |
addTuple(Member... members) |
void |
clear() |
TupleList |
cloneList(int capacity)
Creates a copy of this list that has the same type and has a given
capacity.
|
TupleList |
fix()
Fixes the tuples of this list, so that their contents will not change
even if elements of the list are reordered or removed.
|
List<Member> |
get(int index) |
Member |
get(int slice,
int index)
Returns a particular column of a particular row.
|
int |
getArity()
Returns the number of members in each tuple.
|
Iterator<List<Member>> |
iterator() |
TupleList |
project(int[] destIndices) |
List<Member> |
remove(int index) |
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) |
TupleCursor |
tupleCursor()
Creates a cursor over the contents of this iterable.
|
TupleIterator |
tupleIterator()
Creates an iterator over the contents of this iterable.
|
TupleList |
withPositionCallback(TupleList.PositionCallback positionCallback) |
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addAll, 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.
public TupleList fix()
TupleList
public void clear()
public int size()
public int getArity()
TupleIterable
getArity
in interface TupleIterable
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.
slice
in interface TupleIterable
slice
in interface TupleList
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.
public TupleCursor tupleCursor()
TupleIterable
The contents of the cursor will always be the same as those returned
by TupleIterable.tupleIterator()
. Because TupleCursor
is a simpler API
to implement than TupleIterator
, in some cases the implementation
may be more efficient.
tupleCursor
in interface TupleIterable
public TupleIterator tupleIterator()
TupleIterable
Always has the same effect as calling Iterable.iterator()
.
tupleIterator
in interface TupleIterable
TupleIterable.tupleCursor()
public void addCurrent(TupleCursor tupleIter)
addCurrent
in interface TupleList
public TupleList subList(int fromIndex, int toIndex)
public TupleList withPositionCallback(TupleList.PositionCallback positionCallback)
withPositionCallback
in interface TupleList
Copyright © 2018 Hitachi Vantara. All rights reserved.