org.gcube.indexmanagement.geo.refinement
Class Refiner

java.lang.Object
  extended by org.gcube.indexmanagement.geo.refinement.Refiner

public abstract class Refiner
extends Object

The base class for all Refiners


Field Summary
protected  InclusionType containmentMethod
          The containment method used in the query
protected  GeoIndexType indexType
          The index type of the Index using this Refiner
protected  boolean not
          This flags indicates if we want to return the non-hits instead of the hits
protected  Polygon polygon
          The query Minimal Bounding Rectangle
protected  com.vividsolutions.jts.geom.Envelope query
          The query polygon
 
Constructor Summary
Refiner()
           
 
Method Summary
 void init(Polygon polygon, InclusionType containmentMethod, GeoIndexType indexType, boolean not, String[] args)
          A method called by the GeoIndexResource after creating an instance of a Refiner
protected abstract  void initialize(String[] args)
          The plugin specific initialization method.
abstract  boolean isHit(DataWrapper entry)
          A plugin specific method used to determine which index entries are hits according to the given query.
abstract  boolean isIndexTypeCompatible(GeoIndexType indexType)
          A method used to check if this Refiner plugin is compatible with indices/entries with a specific GeoIndexType
 int refine(List<DataWrapper> entries)
          A method used to refine a list of GeoIndex entries using a plugin specific isHit(entry) method to determine which entries are valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

query

protected com.vividsolutions.jts.geom.Envelope query
The query polygon


polygon

protected Polygon polygon
The query Minimal Bounding Rectangle


indexType

protected GeoIndexType indexType
The index type of the Index using this Refiner


containmentMethod

protected InclusionType containmentMethod
The containment method used in the query


not

protected boolean not
This flags indicates if we want to return the non-hits instead of the hits

Constructor Detail

Refiner

public Refiner()
Method Detail

init

public final void init(Polygon polygon,
                       InclusionType containmentMethod,
                       GeoIndexType indexType,
                       boolean not,
                       String[] args)
                throws RefinerInitializationException
A method called by the GeoIndexResource after creating an instance of a Refiner

Parameters:
polygon - - A polygon representation of the original query of which this Refiner will refine the results
containmentMethod - - The containment method used in the original query
indexType - - The geo index type of the GeoIndex using this Refiner
args - - Any additional plugin specific initialization arguments.
Throws:
RefinerInitializationException - - An error occurex while initializing the Refiner

refine

public final int refine(List<DataWrapper> entries)
A method used to refine a list of GeoIndex entries using a plugin specific isHit(entry) method to determine which entries are valid

Parameters:
entries - - The list of entries to be refined
Returns:
A refined list only containing entries which a valid according to this refiners isHit(entry) method

initialize

protected abstract void initialize(String[] args)
                            throws RefinerInitializationException
The plugin specific initialization method. Initializes an instance of a Refiner plugin using an array of Strings. All other initialization methods have been completed when this method is called, so it can make use of any of the standard Refiner instance variables.

Parameters:
args - - A plugin specific array of Strings used to initialize a Refiner plugin.
Throws:
RefinerInitializationException - - An error occurex while initializing the Refiner

isIndexTypeCompatible

public abstract boolean isIndexTypeCompatible(GeoIndexType indexType)
A method used to check if this Refiner plugin is compatible with indices/entries with a specific GeoIndexType

Parameters:
indexType - - The GeoIndexType of which to check the compatability with this plugin
Returns:
TRUE if this Refiner plugin is compatible with indices/entries with the specified GeoIndexType

isHit

public abstract boolean isHit(DataWrapper entry)
A plugin specific method used to determine which index entries are hits according to the given query.

Parameters:
entry - - the entry to determine if is a hit.
Returns:
TRUE if the entry is a hit according to the Refiner's query.


Copyright © 2012. All Rights Reserved.