net.obsearch.dimension
Class AbstractDimension
java.lang.Object
net.obsearch.dimension.AbstractDimension
- Direct Known Subclasses:
- DimensionByte, DimensionDouble, DimensionFloat, DimensionInt, DimensionLong, DimensionShort
public abstract class AbstractDimension
- extends Object
AbstractDimension stores a dimension (the order it is and some abstract
primitive value).
- Author:
- Arnoldo Jose Muller Molina
Method Summary |
int |
getOrder()
|
protected static long |
mapId(long i,
cern.colt.list.LongArrayList elements)
|
static int |
max(cern.colt.list.LongArrayList source,
Index index)
Returns the max # of elements. |
static long[] |
select(int k,
Random r,
cern.colt.list.LongArrayList source,
Index<OB> index,
cern.colt.list.LongArrayList excludes)
Selects k random elements from the given source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDimension
protected AbstractDimension(int order)
getOrder
public int getOrder()
max
public static int max(cern.colt.list.LongArrayList source,
Index index)
throws OBStorageException
- Returns the max # of elements. if source != null then source.size()
otherwise index.databaseSize();
- Parameters:
source
- The source of data (can be null)index
- The underlying index.
- Returns:
- The max # of elements of source if source != null or of index if
source == null.
- Throws:
OBStorageException
mapId
protected static long mapId(long i,
cern.colt.list.LongArrayList elements)
select
public static long[] select(int k,
Random r,
cern.colt.list.LongArrayList source,
Index<OB> index,
cern.colt.list.LongArrayList excludes)
throws IllegalIdException,
OBException,
IllegalAccessException,
InstantiationException
- Selects k random elements from the given source.
- Parameters:
k
- number of elements to selectr
- Random object used to randomly select objects.source
- The source of item ids.index
- underlying index.will
- not add pivots included in excludes.minDistance
- The min distance required by the objects.
- Returns:
- The ids of selected objects.
- Throws:
IllegalIdException
OBException
IllegalAccessException
InstantiationException
Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.