mondrian.olap
Class Util.Flat2List<T>

java.lang.Object
  extended by mondrian.olap.Util.AbstractFlatList<T>
      extended by mondrian.olap.Util.Flat2List<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, RandomAccess
Enclosing class:
Util

protected static class Util.Flat2List<T>
extends Util.AbstractFlatList<T>

List that stores its two elements in the two members of the class. Unlike ArrayList or Arrays.asList(Object[]) there is no array, only one piece of memory allocated, therefore is very compact and cache and CPU efficient.

The list is read-only, cannot be modified or resized, and neither of the elements can be null.

The list is created via Util.flatList(Object[]).

See Also:
Util.Flat3List

Constructor Summary
Util.Flat2List(T t0, T t1)
           
 
Method Summary
 boolean equals(Object o)
           
 T get(int index)
           
 int hashCode()
           
 int indexOf(Object o)
           
 int lastIndexOf(Object o)
           
 int size()
           
 Object[] toArray()
           
<T2> T2[]
toArray(T2[] a)
           
 String toString()
           
 
Methods inherited from class mondrian.olap.Util.AbstractFlatList
add, add, addAll, addAll, asArrayList, clear, contains, containsAll, isEmpty, iterator, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Util.Flat2List

Util.Flat2List(T t0,
               T t1)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

get

public T get(int index)

size

public int size()

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<T>
Specified by:
equals in interface List<T>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<T>
Specified by:
hashCode in interface List<T>
Overrides:
hashCode in class Object

indexOf

public int indexOf(Object o)

lastIndexOf

public int lastIndexOf(Object o)

toArray

public <T2> T2[] toArray(T2[] a)

toArray

public Object[] toArray()

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