mondrian.calc.impl
Class AbstractEndToEndTupleList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<List<Member>>
          extended by mondrian.calc.impl.AbstractTupleList
              extended by mondrian.calc.impl.AbstractEndToEndTupleList
All Implemented Interfaces:
Cloneable, Iterable<List<Member>>, Collection<List<Member>>, List<List<Member>>, RandomAccess, TupleIterable, TupleList
Direct Known Subclasses:
ArrayTupleList, ListTupleList

abstract class AbstractEndToEndTupleList
extends AbstractTupleList

Abstract implementation of a TupleList that stores tuples in end-to-end format.

For example, if the arity is 3, the tuples {(A1, B1, C1), (A1, B2, C2)} will be stored as {A1, B1, C1, A2, B2, C2}. This is memory-efficient (only one array, compared to 3 arrays or one array per tuple in other representations), has good locality of reference, and typical operations require few indirections.

Concrete subclasses can store the data in various backing lists.

Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.calc.impl.AbstractTupleList
AbstractTupleList.AbstractTupleListIterator
 
Nested classes/interfaces inherited from interface mondrian.calc.TupleList
TupleList.PositionCallback
 
Field Summary
 
Fields inherited from class mondrian.calc.impl.AbstractTupleList
arity, mutable
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AbstractEndToEndTupleList(int arity)
           
 
Method Summary
 boolean addAll(Collection<? extends List<Member>> c)
           
 boolean addAll(int i, Collection<? extends List<Member>> c)
           
protected abstract  List<Member> backingList()
           
 TupleList project(int[] destIndices)
           
 List<Member> set(int index, List<Member> element)
           
 TupleList subList(int fromIndex, int toIndex)
           
 TupleList withPositionCallback(TupleList.PositionCallback positionCallback)
           
 
Methods inherited from class mondrian.calc.impl.AbstractTupleList
addCurrent, fix, get, getArity, iterator, tupleCursor, tupleIterator, tupleIteratorInternal
 
Methods inherited from class java.util.AbstractList
add, add, clear, equals, get, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mondrian.calc.TupleList
addTuple, cloneList, slice
 
Methods inherited from interface java.util.List
add, add, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractEndToEndTupleList

AbstractEndToEndTupleList(int arity)
Method Detail

project

public TupleList project(int[] destIndices)

backingList

protected abstract List<Member> backingList()

set

public List<Member> set(int index,
                        List<Member> element)
Specified by:
set in interface List<List<Member>>
Overrides:
set in class AbstractList<List<Member>>

addAll

public boolean addAll(Collection<? extends List<Member>> c)
Specified by:
addAll in interface Collection<List<Member>>
Specified by:
addAll in interface List<List<Member>>
Overrides:
addAll in class AbstractCollection<List<Member>>

addAll

public boolean addAll(int i,
                      Collection<? extends List<Member>> c)
Specified by:
addAll in interface List<List<Member>>
Overrides:
addAll in class AbstractList<List<Member>>

subList

public TupleList subList(int fromIndex,
                         int toIndex)
Specified by:
subList in interface List<List<Member>>
Specified by:
subList in interface TupleList
Specified by:
subList in class AbstractTupleList

withPositionCallback

public TupleList withPositionCallback(TupleList.PositionCallback positionCallback)

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads