Package com.macrofocus.molap.index
Class DefaultUniqueIndex<K>
- java.lang.Object
-
- com.macrofocus.index.AbstractIndex<K>
-
- com.macrofocus.molap.index.AbstractUniqueIndex<K>
-
- com.macrofocus.molap.index.DefaultUniqueIndex<K>
-
- All Implemented Interfaces:
com.macrofocus.index.Index<K>
,UniqueIndex<K>
public class DefaultUniqueIndex<K> extends AbstractUniqueIndex<K>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.macrofocus.molap.index.UniqueIndex
UniqueIndex.Duplicate
-
-
Constructor Summary
Constructors Constructor Description DefaultUniqueIndex(UniqueIndex.Duplicate duplicate, K... keys)
Creates a new index with an ordered list of unique keys.DefaultUniqueIndex(UniqueIndex<K> index, java.util.Comparator<K> comparator)
DefaultUniqueIndex(java.lang.Iterable<K> keys, boolean includeNull)
Creates a new index with a set of keys.DefaultUniqueIndex(java.util.List<K> keys)
Creates a new index with a set of keys.DefaultUniqueIndex(K... keys)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(K key)
int
getAddress(K key)
K
getKey(int i)
int
getSize()
UniqueIndex<K>
head(int count)
UniqueIndex<K>
keepAddresses(int[] addresses)
java.lang.Iterable<K>
keys()
DefaultUniqueIndex<K>
remove(K... keys)
UniqueIndex<K>
tail(int count)
-
Methods inherited from class com.macrofocus.molap.index.AbstractUniqueIndex
difference, intersection, union
-
-
-
-
Constructor Detail
-
DefaultUniqueIndex
public DefaultUniqueIndex(java.lang.Iterable<K> keys, boolean includeNull)
Creates a new index with a set of keys. Note: the keys do not need to be unique- Parameters:
keys
- the keys
-
DefaultUniqueIndex
public DefaultUniqueIndex(java.util.List<K> keys)
Creates a new index with a set of keys. Note: the keys do not need to be unique- Parameters:
keys
- the keys
-
DefaultUniqueIndex
public DefaultUniqueIndex(K... keys)
-
DefaultUniqueIndex
public DefaultUniqueIndex(UniqueIndex.Duplicate duplicate, K... keys)
Creates a new index with an ordered list of unique keys.- Parameters:
keys
- the unique keys
-
DefaultUniqueIndex
public DefaultUniqueIndex(UniqueIndex<K> index, java.util.Comparator<K> comparator)
-
-
Method Detail
-
contains
public boolean contains(K key)
-
getAddress
public int getAddress(K key)
-
keys
public java.lang.Iterable<K> keys()
- Specified by:
keys
in interfacecom.macrofocus.index.Index<K>
- Overrides:
keys
in classAbstractUniqueIndex<K>
-
getKey
public K getKey(int i)
-
getSize
public int getSize()
-
head
public UniqueIndex<K> head(int count)
-
tail
public UniqueIndex<K> tail(int count)
-
keepAddresses
public UniqueIndex<K> keepAddresses(int[] addresses)
-
remove
public DefaultUniqueIndex<K> remove(K... keys)
-
-