org.gcube.indexmanagement.geo
Class DataWrapper

java.lang.Object
  extended by org.gcube.indexmanagement.geo.DataWrapper

public class DataWrapper
extends Object

A utility class used to read and administer the data, coordinates and id of a GeoIndex entry. *


Field Summary
static String DEFAULT_CHARSET
           
static String OFFSET_SEPARATOR
           
 
Method Summary
static org.geotools.index.DataDefinition createDefinition()
          A method to generate the default GeoTools DataDefinition object.
 String getColID()
           
 String getColLang()
           
 org.geotools.index.Data getData()
          A getter method for the Data
 String getID()
          A getter method for the ID
static DataWrapper getInstance(GeoIndexType indexTypeObject, org.geotools.index.Data data, RandomAccessFile rawDataFile)
          A method used to get a DataWrapper instance from a GeoTools Data object
static DataWrapper getInstance(GeoIndexType indexTypeObject, ReadableByteChannel inChannel, RandomAccessFile rawDataFile)
          A method used to create a DataWrapper instance from an IndexType and a DeltaFile input channel
 long getMaxX()
          A getter method for the highest X coordinate
 long getMaxY()
          A getter method for the highest Y coordinate
 com.vividsolutions.jts.geom.Envelope getMbr()
          A method to get the Minimum Bounding Rectangle of the entry
 long getMinX()
          A getter method for the lowest X coordinate
 long getMinY()
          A getter method for the lowest Y coordinate
 Object getValue(String fieldName)
          A method to get the value of the IndexType field with the specified field name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFFSET_SEPARATOR

public static final String OFFSET_SEPARATOR
See Also:
Constant Field Values

DEFAULT_CHARSET

public static final String DEFAULT_CHARSET
See Also:
Constant Field Values
Method Detail

getMinX

public long getMinX()
A getter method for the lowest X coordinate

Returns:
the lowest X coordinate of the entry

getMaxX

public long getMaxX()
A getter method for the highest X coordinate

Returns:
the highest X coordinate of the entry

getMinY

public long getMinY()
A getter method for the lowest Y coordinate

Returns:
the lowest Y coordinate of the entry

getMaxY

public long getMaxY()
A getter method for the highest Y coordinate

Returns:
the highest Y coordinate of the entry

getID

public String getID()
A getter method for the ID

Returns:
the ID of the entry

getData

public org.geotools.index.Data getData()
A getter method for the Data

Returns:
the data type of data

getMbr

public com.vividsolutions.jts.geom.Envelope getMbr()
A method to get the Minimum Bounding Rectangle of the entry

Returns:
the Minimum Bounding Rectangle of the entry

getValue

public Object getValue(String fieldName)
A method to get the value of the IndexType field with the specified field name

Parameters:
fieldName - - the fields index/placement in the IndexType
Returns:
the value of the field. NULL if the field isn't found.

getInstance

public static DataWrapper getInstance(GeoIndexType indexTypeObject,
                                      org.geotools.index.Data data,
                                      RandomAccessFile rawDataFile)
                               throws Exception
A method used to get a DataWrapper instance from a GeoTools Data object

Parameters:
indexTypeObject - - a GeoTools Data object containing the coordinates and id as the first five fields
data - - The data for the GeoTools data object.
Returns:
a DataWrapper representation of the Data object
Throws:
Exception

getInstance

public static DataWrapper getInstance(GeoIndexType indexTypeObject,
                                      ReadableByteChannel inChannel,
                                      RandomAccessFile rawDataFile)
                               throws IndexException
A method used to create a DataWrapper instance from an IndexType and a DeltaFile input channel

Parameters:
indexTypeObject - - The indexType of the entry
inChannel - - An input channel reading from a DeltaFile
Returns:
a DataWrapper representation of the next obect read from the DeltaFile. Null upon EOF.
Throws:
IndexException - an error reading from the DeltaFile

createDefinition

public static org.geotools.index.DataDefinition createDefinition()
A method to generate the default GeoTools DataDefinition object. The default definition contains the id, the 4 coordinates, and a String variable field for all the fields of a document(this makes possible the different structure of the fields for each document)

Returns:
a DataDefinition representation of the IndexType

getColID

public String getColID()

getColLang

public String getColLang()


Copyright © 2012. All Rights Reserved.