O
- Outer object type.I
- Inner object type.public class ProjectedIndex<O,I> extends Object implements KNNIndex<O>, RKNNIndex<O>, RangeIndex<O>
LatLngAsECEFIndex
and LngLatAsECEFIndex
for example
indexes that support only a specific (good) combination.
FIXME: add refinement to bulk queries!Modifier and Type | Class and Description |
---|---|
static class |
ProjectedIndex.Factory<O,I>
Index factory.
|
(package private) class |
ProjectedIndex.ProjectedKNNQuery<D extends Distance<D>>
Class to proxy kNN queries.
|
(package private) class |
ProjectedIndex.ProjectedRangeQuery<D extends Distance<D>>
Class to proxy range queries.
|
(package private) class |
ProjectedIndex.ProjectedRKNNQuery<D extends Distance<D>>
Class to proxy RkNN queries.
|
Modifier and Type | Field and Description |
---|---|
(package private) Index |
inner
Inner index.
|
(package private) double |
kmulti
Multiplier for k.
|
private static Logging |
LOG
Class logger
|
(package private) boolean |
norefine
Refinement disable flag.
|
(package private) Projection<O,I> |
proj
Projection.
|
(package private) Counter |
refinements
Count the number of distance refinements computed.
|
(package private) Relation<O> |
relation
The relation we predend to index.
|
(package private) Relation<I> |
view
The view that we really index.
|
Constructor and Description |
---|
ProjectedIndex(Relation<O> relation,
Projection<O,I> proj,
Relation<I> view,
Index inner,
boolean norefine,
double kmulti)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
countRefinement()
Count a single distance refinement.
|
<D extends Distance<D>> |
getKNNQuery(DistanceQuery<O,D> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query and k.
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
<D extends Distance<D>> |
getRangeQuery(DistanceQuery<O,D> distanceQuery,
Object... hints)
Get a range query object for the given distance query and k.
|
<D extends Distance<D>> |
getRKNNQuery(DistanceQuery<O,D> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query and k.
|
String |
getShortName()
A short name for the result, useful for file names.
|
void |
initialize()
Initialize the index.
|
void |
logStatistics()
Send statistics to the logger, if enabled.
|
private static final Logging LOG
Index inner
Projection<O,I> proj
boolean norefine
double kmulti
final Counter refinements
public ProjectedIndex(Relation<O> relation, Projection<O,I> proj, Relation<I> view, Index inner, boolean norefine, double kmulti)
relation
- Relation to index.proj
- Projection to use.view
- View to use.inner
- Index to wrap.norefine
- Refinement disable flag.kmulti
- Multiplicator for kprivate void countRefinement()
public void initialize()
Index
initialize
in interface Index
public String getLongName()
Result
getLongName
in interface Result
public String getShortName()
Result
getShortName
in interface Result
public void logStatistics()
Index
logStatistics
in interface Index
public <D extends Distance<D>> KNNQuery<O,D> getKNNQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
KNNIndex
getKNNQuery
in interface KNNIndex<O>
D
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizernull
public <D extends Distance<D>> RangeQuery<O,D> getRangeQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
RangeIndex
getRangeQuery
in interface RangeIndex<O>
D
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizernull
public <D extends Distance<D>> RKNNQuery<O,D> getRKNNQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
RKNNIndex
getRKNNQuery
in interface RKNNIndex<O>
D
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizernull