Package mondrian.calc.impl
Class ListTupleList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<List<Member>>
mondrian.calc.impl.AbstractTupleList
mondrian.calc.impl.ListTupleList
- All Implemented Interfaces:
Cloneable,Iterable<List<Member>>,Collection<List<Member>>,List<List<Member>>,RandomAccess,TupleIterable,TupleList
Implementation of
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
- Author:
- jhyde
-
Nested Class Summary
Nested classes/interfaces inherited from class mondrian.calc.impl.AbstractTupleList
AbstractTupleList.AbstractTupleListIteratorNested classes/interfaces inherited from interface mondrian.calc.TupleList
TupleList.PositionCallback -
Field Summary
Fields inherited from class mondrian.calc.impl.AbstractTupleList
arity, mutableFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanaddAll(int i, Collection<? extends List<Member>> c) booleanaddAll(Collection<? extends List<Member>> c) voidvoidclear()cloneList(int capacity) Creates a copy of this list that has the same type and has a given capacity.get(int index) get(int slice, int index) Returns a particular column of a particular row.project(int[] destIndices) remove(int index) protected voidremoveRange(int fromIndex, int toIndex) intsize()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 class mondrian.calc.impl.AbstractTupleList
addCurrent, fix, getArity, iterator, tupleCursor, tupleIteratorMethods inherited from class java.util.AbstractList
add, equals, hashCode, indexOf, lastIndexOf, listIterator, listIteratorMethods inherited from class java.util.AbstractCollection
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
add, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
ListTupleList
Creates a ListTupleList.- Parameters:
arity- Aritylist- Backing list
-
-
Method Details
-
backingList
-
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.- Specified by:
getin interfaceTupleList- Overrides:
getin classAbstractTupleList- Parameters:
slice- Column ordinalindex- Row ordinal- Returns:
- Member at given row and column
-
get
-
add
-
addTuple
-
clear
public void clear() -
remove
-
removeRange
protected void removeRange(int fromIndex, int toIndex) - Overrides:
removeRangein classAbstractList<List<Member>>
-
size
public int size() -
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.
- 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.
- Parameters:
capacity- Capacity- Returns:
- Copy of list, empty if capacity is non-negative
-
tupleIteratorInternal
- Specified by:
tupleIteratorInternalin classAbstractTupleList
-
project
-
set
-
addAll
-
addAll
-
subList
-
withPositionCallback
-