Class UnaryTupleList
- All Implemented Interfaces:
Iterable<List<Member>>,Collection<List<Member>>,List<List<Member>>,TupleIterable,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).
- Author:
- jhyde
-
Nested Class Summary
Nested classes/interfaces inherited from interface mondrian.calc.TupleList
TupleList.PositionCallback -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty UnaryTupleList.UnaryTupleList(List<Member> list) Creates a UnaryTupleList with a given backing list. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidaddCurrent(TupleCursor tupleIter) voidvoidclear()cloneList(int capacity) Creates a copy of this list that has the same type and has a given capacity.fix()Fixes the tuples of this list, so that their contents will not change even if elements of the list are reordered or removed.get(int index) get(int slice, int index) Returns a particular column of a particular row.intgetArity()Returns the number of members in each tuple.iterator()project(int[] destIndices) remove(int index) intsize()slice(int column) Returns a list of the members at a given column.subList(int fromIndex, int toIndex) Creates a cursor over the contents of this iterable.Creates an iterator over the contents of this iterable.withPositionCallback(TupleList.PositionCallback positionCallback) Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRangeMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, addAll, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
UnaryTupleList
public UnaryTupleList()Creates an empty UnaryTupleList. -
UnaryTupleList
Creates a UnaryTupleList with a given backing list.- Parameters:
list- Backing list
-
-
Method Details
-
get
Description copied from interface:TupleListReturns a particular column of a particular row.Note that
list.get(row, column)is equivalent tolist.slice(column).get(row)andlist.get(row).get(column)but is more efficient for most implementations of TupleList. -
get
-
add
-
add
-
fix
Description copied from interface:TupleListFixes the tuples of this list, so that their contents will not change even if elements of the list are reordered or removed. Returns this list if possible. -
set
-
remove
-
clear
public void clear() -
size
public int size() -
getArity
public int getArity()Description copied from interface:TupleIterableReturns the number of members in each tuple.- Specified by:
getArityin interfaceTupleIterable- Returns:
- The number of members in each tuple
-
slice
Description copied from interface:TupleListReturns a list of the members at a given column.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.
- Specified by:
slicein interfaceTupleIterable- Specified by:
slicein interfaceTupleList- Parameters:
column- Ordinal of the member in each tuple to project- Returns:
- List of members
-
cloneList
Description copied from interface:TupleListCreates a copy of this list that has the same type and has a given capacity.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.
-
tupleCursor
Description copied from interface:TupleIterableCreates a cursor over the contents of this iterable.The contents of the cursor will always be the same as those returned by
TupleIterable.tupleIterator(). BecauseTupleCursoris a simpler API to implement thanTupleIterator, in some cases the implementation may be more efficient.- Specified by:
tupleCursorin interfaceTupleIterable- Returns:
- cursor over the tuples returned by this iterable
-
tupleIterator
Description copied from interface:TupleIterableCreates an iterator over the contents of this iterable.Always has the same effect as calling
Iterable.iterator().- Specified by:
tupleIteratorin interfaceTupleIterable- Returns:
- cursor over the tuples returned by this iterable
- See Also:
-
iterator
-
project
-
addTuple
-
addCurrent
- Specified by:
addCurrentin interfaceTupleList
-
subList
-
withPositionCallback
- Specified by:
withPositionCallbackin interfaceTupleList
-