Package com.illumon.iris.db.v2.utils
Class AbstractFactory
java.lang.Object
com.illumon.iris.db.v2.utils.AbstractFactory
- All Implemented Interfaces:
Index.Factory
This is the base class for factories that construct
Index
es.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFlatIndex
(long size) Get a flatIndex
containing the range [0, size), or anempty index
if the specified size is <= 0.getIndexByRange
(long firstKey, long lastKey) Create anIndex
containing the continuous range [firstKey, lastKey]getIndexByValues
(long key) Produce an index containing a single key.getIndexByValues
(long... keys) Get anIndex
containing the specified keys.getIndexByValues
(gnu.trove.list.array.TLongArrayList list) Get anIndex
containing the specified keys.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.utils.Index.Factory
getBuilder, getEmptyIndex, getRandomBuilder, getSequentialBuilder
-
Constructor Details
-
AbstractFactory
public AbstractFactory()
-
-
Method Details
-
getIndexByValues
Description copied from interface:Index.Factory
Get anIndex
containing the specified keys. All keys must be positive numbers- Specified by:
getIndexByValues
in interfaceIndex.Factory
- Parameters:
keys
- The keys to add to the index- Returns:
- An index containing the specified keys
-
getIndexByValues
Description copied from interface:Index.Factory
Produce an index containing a single key.- Specified by:
getIndexByValues
in interfaceIndex.Factory
- Parameters:
key
- the key that will exist in the new Index- Returns:
- a new Index containing key
-
getIndexByValues
Description copied from interface:Index.Factory
Get anIndex
containing the specified keys. The provided list is sorted, and then passed to a sequential builder.- Specified by:
getIndexByValues
in interfaceIndex.Factory
- Parameters:
list
- a Trove long array list; note that this list is mutated within the method- Returns:
- an Index containing the values from list
-
getIndexByRange
Description copied from interface:Index.Factory
Create anIndex
containing the continuous range [firstKey, lastKey]- Specified by:
getIndexByRange
in interfaceIndex.Factory
- Parameters:
firstKey
- The first key in the continuous rangelastKey
- The last key in the continuous range- Returns:
- An index containing the specified range
-
getFlatIndex
Description copied from interface:Index.Factory
Get a flatIndex
containing the range [0, size), or anempty index
if the specified size is <= 0.- Specified by:
getFlatIndex
in interfaceIndex.Factory
- Parameters:
size
- The size of the index to create- Returns:
- A flat index containing the keys [0, size) or an empty index if the size is <= 0
-