Package mondrian.calc
Interface TupleList
- All Superinterfaces:
Collection<List<Member>>
,Iterable<List<Member>>
,List<List<Member>>
,TupleIterable
- All Known Implementing Classes:
AbstractTupleList
,ArrayTupleList
,DelegatingTupleList
,ListTupleList
,UnaryTupleList
List of tuples.
Design notes
- Consider changing
TupleCalc.evaluateTuple(mondrian.olap.Evaluator)
andEvaluator.NamedSetEvaluator.currentTuple()
to List<Member> - Search for potential uses of
get(int, int)
- Worth creating
TupleList
.addAll(TupleIterator)?
- Author:
- jhyde
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCurrent
(TupleCursor tupleIter) void
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 slice, int index) Returns a particular column of a particular row.project
(int[] destIndices) slice
(int column) Returns a list of the members at a given column.subList
(int fromIndex, int toIndex) withPositionCallback
(TupleList.PositionCallback positionCallback) Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArray
Methods inherited from interface mondrian.calc.TupleIterable
getArity, tupleCursor, tupleIterator
-
Method Details
-
get
Returns 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.- Parameters:
slice
- Column ordinalindex
- Row ordinal- Returns:
- Member at given row and column
-
slice
Returns 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:
slice
in interfaceTupleIterable
- Parameters:
column
- Ordinal of the member in each tuple to project- Returns:
- List of members
- Throws:
IllegalArgumentException
- if column is not less than arity
-
cloneList
Creates 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.
- Parameters:
capacity
- Capacity- Returns:
- Copy of list, empty if capacity is non-negative
-
addTuple
-
project
-
addCurrent
-
subList
-
withPositionCallback
-
fix
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. Returns this list if possible.- Returns:
- List whose tuples are invariant if the list is sorted or filtered
-