|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<List<Member>>
mondrian.calc.impl.UnaryTupleList
public class UnaryTupleList
Implementation of 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).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface mondrian.calc.TupleList |
|---|
TupleList.PositionCallback |
| Field Summary | |
|---|---|
(package private) List<Member> |
list
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
UnaryTupleList()
Creates an empty UnaryTupleList. |
|
UnaryTupleList(List<Member> list)
Creates a UnaryTupleList with a given backing list. |
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.util.AbstractList |
|---|
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, addAll, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, toArray, toArray |
| Field Detail |
|---|
final List<Member> list
| Constructor Detail |
|---|
public UnaryTupleList()
public UnaryTupleList(List<Member> list)
list - Backing list| Method Detail |
|---|
public Member get(int slice,
int index)
TupleListNote 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 TupleListslice - Column ordinalindex - Row ordinal
public List<Member> get(int index)
get in interface List<List<Member>>get in class AbstractList<List<Member>>
public void add(int index,
List<Member> element)
add in interface List<List<Member>>add in class AbstractList<List<Member>>public boolean add(List<Member> element)
add in interface Collection<List<Member>>add in interface List<List<Member>>add in class AbstractList<List<Member>>public TupleList fix()
TupleList
fix in interface TupleList
public List<Member> set(int index,
List<Member> element)
set in interface List<List<Member>>set in class AbstractList<List<Member>>public List<Member> remove(int index)
remove in interface List<List<Member>>remove in class AbstractList<List<Member>>public void clear()
clear in interface Collection<List<Member>>clear in interface List<List<Member>>clear in class AbstractList<List<Member>>public int size()
size in interface Collection<List<Member>>size in interface List<List<Member>>size in class AbstractCollection<List<Member>>public int getArity()
TupleIterable
getArity in interface TupleIterablepublic List<Member> slice(int column)
TupleListThe 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 TupleIterableslice in interface TupleListcolumn - Ordinal of the member in each tuple to project
public TupleList cloneList(int capacity)
TupleListIf 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.
cloneList in interface TupleListcapacity - Capacity
public TupleCursor tupleCursor()
TupleIterableThe 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 TupleIterablepublic TupleIterator tupleIterator()
TupleIterableAlways has the same effect as calling Iterable.iterator().
tupleIterator in interface TupleIterableTupleIterable.tupleCursor()public final Iterator<List<Member>> iterator()
iterator in interface Iterable<List<Member>>iterator in interface Collection<List<Member>>iterator in interface List<List<Member>>iterator in class AbstractList<List<Member>>public TupleList project(int[] destIndices)
project in interface TupleListpublic void addTuple(Member... members)
addTuple in interface TupleListpublic void addCurrent(TupleCursor tupleIter)
addCurrent in interface TupleList
public TupleList subList(int fromIndex,
int toIndex)
subList in interface List<List<Member>>subList in interface TupleListsubList in class AbstractList<List<Member>>public TupleList withPositionCallback(TupleList.PositionCallback positionCallback)
withPositionCallback in interface TupleList
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||