Package com.illumon.iris.db.v2.utils
Class AbstractFactory
java.lang.Object
com.illumon.iris.db.v2.utils.AbstractFactory
- All Implemented Interfaces:
Index.Factory
public abstract class AbstractFactory extends Object implements Index.Factory
This is the base class for factories that construct
Indexes.-
Constructor Summary
Constructors Constructor Description AbstractFactory() -
Method Summary
Modifier and Type Method Description IndexgetFlatIndex(long size)Get a flatIndexcontaining the range [0, size), or anempty indexif the specified size is <= 0.IndexgetIndexByRange(long firstKey, long lastKey)Create anIndexcontaining the continuous range [firstKey, lastKey]IndexgetIndexByValues(long key)Produce an index containing a single key.IndexgetIndexByValues(long... keys)Get anIndexcontaining the specified keys.IndexgetIndexByValues(gnu.trove.list.array.TLongArrayList list)Get anIndexcontaining the specified keys.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.FactoryGet anIndexcontaining the specified keys. All keys must be positive numbers- Specified by:
getIndexByValuesin interfaceIndex.Factory- Parameters:
keys- The keys to add to the index- Returns:
- An index containing the specified keys
-
getIndexByValues
Description copied from interface:Index.FactoryProduce an index containing a single key.- Specified by:
getIndexByValuesin 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.FactoryGet anIndexcontaining the specified keys. The provided list is sorted, and then passed to a sequential builder.- Specified by:
getIndexByValuesin 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.FactoryCreate anIndexcontaining the continuous range [firstKey, lastKey]- Specified by:
getIndexByRangein 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.FactoryGet a flatIndexcontaining the range [0, size), or anempty indexif the specified size is <= 0.- Specified by:
getFlatIndexin 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
-