deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.datastore
Class FeatureId

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

public class FeatureId
extends java.lang.Object
implements java.lang.Comparable<FeatureId>

Used to identify persistent (stored) feature instances.

Version:
$Revision: 22080 $, $Date: 2010-01-21 13:24:52 +0100 (Do, 21 Jan 2010) $
Author:
Markus Schneider , last edited by: $Author: aschmitz $

Constructor Summary
FeatureId(MappedFeatureType ft, java.lang.Object[] values)
          Creates a new instance of FeatureId from the given parameters.
FeatureId(MappedFeatureType ft, java.lang.String fid)
          Creates a new instance of FeatureId from the given parameters.
FeatureId(MappedGMLId fidDefinition, java.lang.Object[] values)
          Deprecated. use FeatureId(MappedFeatureType, Object[]) instead
FeatureId(MappedGMLId fidDefinition, java.lang.String fid)
          Deprecated. use FeatureId(MappedFeatureType, String) instead
 
Method Summary
 int compareTo(FeatureId that)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.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.
 java.lang.Object getValue(int i)
          Returns a certain column value of the key.
 java.lang.Object[] getValues()
          Returns all column values of the key.
 int hashCode()
           
static java.lang.Object removeFIDPrefix(java.lang.String id, MappedGMLId idMapping)
          Removes the prefix from the given feature id.
 java.lang.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,
                 java.lang.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,
                 java.lang.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,
                            java.lang.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,
                            java.lang.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 java.lang.Object[] getValues()
Returns all column values of the key.

Returns:
all column values of the key

getValue

public java.lang.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 java.lang.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 java.lang.Comparable<FeatureId>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

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

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

removeFIDPrefix

public static java.lang.Object removeFIDPrefix(java.lang.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.5 (2011/06/29 09:44 build-8-official)

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