deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.datastore
Class FeatureId

java.lang.Object
  extended by org.deegree.io.datastore.FeatureId
All Implemented Interfaces:
Comparable<FeatureId>

public class FeatureId
extends Object
implements Comparable<FeatureId>

Used to identify persistent (stored) feature instances.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Constructor Summary
FeatureId(MappedFeatureType ft, Object[] values)
          Creates a new instance of FeatureId from the given parameters.
FeatureId(MappedFeatureType ft, String fid)
          Creates a new instance of FeatureId from the given parameters.
FeatureId(MappedGMLId fidDefinition, Object[] values)
          Deprecated. use FeatureId(MappedFeatureType, Object[]) instead
FeatureId(MappedGMLId fidDefinition, String fid)
          Deprecated. use FeatureId(MappedFeatureType, String) instead
 
Method Summary
 int compareTo(FeatureId that)
           
 boolean equals(Object obj)
           
 String getAsString()
          Returns the canonical textual representation, i.e. the key components, separated by the separator defined in the associated MappedGMLId.
 MappedFeatureType getFeatureType()
          Return the MappedFeatureType of the identified feature.
 MappedGMLId getFidDefinition()
          Return the underlying MappedGMLId.
 int getLength()
          Returns the number of components that the key consists of.
 Object getValue(int i)
          Returns a certain column value of the key.
 Object[] getValues()
          Returns all column values of the key.
 int hashCode()
           
static Object removeFIDPrefix(String id, MappedGMLId idMapping)
          Removes the prefix from the given feature id.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureId

public FeatureId(MappedFeatureType ft,
                 Object[] values)
Creates a new instance of FeatureId from the given parameters.

Parameters:
ft - cannot be null, must not be an abstract feature type
values - cannot be null or empty

FeatureId

public FeatureId(MappedFeatureType ft,
                 String fid)
          throws IdGenerationException
Creates a new instance of FeatureId from the given parameters.

Parameters:
ft - cannot be null, must not be an abstract feature type
fid - cannot be null
Throws:
IdGenerationException

FeatureId

@Deprecated
public FeatureId(MappedGMLId fidDefinition,
                            Object[] values)
Deprecated. use FeatureId(MappedFeatureType, Object[]) instead

Creates a new instance of FeatureId from the given parameters.

Parameters:
fidDefinition - cannot be null
values -

FeatureId

@Deprecated
public FeatureId(MappedGMLId fidDefinition,
                            String fid)
          throws IdGenerationException
Deprecated. use FeatureId(MappedFeatureType, String) instead

Creates a new instance of FeatureId from the given parameters.

Parameters:
fidDefinition - cannot be null
fid - cannot be null
Throws:
IdGenerationException
Method Detail

getFeatureType

public MappedFeatureType getFeatureType()
Return the MappedFeatureType of the identified feature.

The feature type is concrete, never abstract.

Returns:
type of the identified feature, never abstract

getFidDefinition

public MappedGMLId getFidDefinition()
Return the underlying MappedGMLId.

Returns:
MappedGMLId

getLength

public int getLength()
Returns the number of components that the key consists of.

Returns:
the number of components that the key consists of

getValues

public Object[] getValues()
Returns all column values of the key.

Returns:
all column values of the key

getValue

public Object getValue(int i)
Returns a certain column value of the key.

Parameters:
i - requested column
Returns:
the requested column value of the key

getAsString

public String getAsString()
Returns the canonical textual representation, i.e. the key components, separated by the separator defined in the associated MappedGMLId.

Returns:
the canonical textual representation

compareTo

public int compareTo(FeatureId that)
Specified by:
compareTo in interface Comparable<FeatureId>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object

removeFIDPrefix

public static Object removeFIDPrefix(String id,
                                     MappedGMLId idMapping)
                              throws IdGenerationException
Removes the prefix from the given feature id.

The prefix is taken from the given gml:id mapping.

Parameters:
id - feature id (including prefix).
idMapping - target gml:id mapping (where the fid will be stored)
Returns:
feature id (without prefix) as an object of the right type (matching the table column)
Throws:
IdGenerationException - if the given fid does not begin with the expected prefix from the gml:id mapping

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org