org.deegree_impl.model.feature
Class FeatureFactory

java.lang.Object
  extended byorg.deegree_impl.model.feature.FeatureFactory

public class FeatureFactory
extends java.lang.Object

This factory offers methods for creating Features, FeatureCollection and all direct related classes/interfaces that are part of the org.deegree.model.feature package.

-----------------------------------------------------------------------

Version:
$Revision: 1.17 $ $Date: 2004/03/29 10:38:09 $
Author:
Andreas Poth

Constructor Summary
FeatureFactory()
           
 
Method Summary
static Feature createFeature(GMLFeature gmlFeature)
          creates an instance of a Feature from its FeatureType and a GMLFeature that contains the features data.
static Feature createFeature(java.lang.String id, FeatureType featureType, FeatureProperty[] properties)
          creates an instance of a Feature from its FeatureType and an array of Objects that represents it properties.
static Feature createFeature(java.lang.String id, FeatureType featureType, java.lang.Object[] properties)
          creates an instance of a Feature from its FeatureType and an array of Objects that represents it properties.
static FeatureCollection createFeatureCollection(GMLFeatureCollection gmlFc)
          creates an instance of a FeatureCollection from a GMLFeatureCollection
static FeatureCollection createFeatureCollection(java.lang.String id, Feature[] features)
          creates an instance of a FeatureCollection from an array of Features.
static FeatureCollection createFeatureCollection(java.lang.String id, FeatureType featureType, FeatureProperty[] properties, int initialCapacity)
          creates an instance of a FeatureCollection with an initial capacity and a defined featuretype.
static FeatureCollection createFeatureCollection(java.lang.String id, int initialCapacity)
          creates an instance of a FeatureCollection with an initial capacity.
static FeatureProperty createFeatureProperty(java.lang.String name, java.lang.Object value)
          creates an instance of a FeatureProperty from its name and the data (value) it contains
static FeatureType createFeatureType(FeatureType[] parents, FeatureType[] children, java.lang.String name, FeatureTypeProperty[] properties)
          creates an instance of a FeatureType from an array of FeatureTypeProperties, its parents and childs and its name.
static FeatureTypeProperty createFeatureTypeProperty(java.lang.String name, java.lang.String type, boolean nullable)
          creates an instance of a FeatureTypeProperty from its name and the data type it describes
private static java.lang.String getType(int t)
          returns the name of the (toplevel)class that is assigned to the submitted GML property type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureFactory

public FeatureFactory()
Method Detail

createFeatureTypeProperty

public static FeatureTypeProperty createFeatureTypeProperty(java.lang.String name,
                                                            java.lang.String type,
                                                            boolean nullable)
creates an instance of a FeatureTypeProperty from its name and the data type it describes

Parameters:
name - name of the feature type property
type - type represented by the feature type property
nullable - true if the feature type property is allowed to be null
Returns:
instance of a FeatureTypeProperty

createFeatureType

public static FeatureType createFeatureType(FeatureType[] parents,
                                            FeatureType[] children,
                                            java.lang.String name,
                                            FeatureTypeProperty[] properties)
creates an instance of a FeatureType from an array of FeatureTypeProperties, its parents and childs and its name.

Parameters:
parents - parents of the FeatureType
children - known children of the FeatureType
name - name of the FeatureType
properties - properties containing the FeatureTypes content
Returns:
instance of a FeatureType

createFeatureProperty

public static FeatureProperty createFeatureProperty(java.lang.String name,
                                                    java.lang.Object value)
creates an instance of a FeatureProperty from its name and the data (value) it contains

Parameters:
name - name of the FeatureProperty
value - value of the FeatureProperty
Returns:
an instance of a FeatureProperty

createFeature

public static Feature createFeature(java.lang.String id,
                                    FeatureType featureType,
                                    java.lang.Object[] properties)
creates an instance of a Feature from its FeatureType and an array of Objects that represents it properties. It is assumed that the order of the properties is identical to the order of the FeatureTypeProperties of the the FeatureType.

Parameters:
id - unique id of the Feature
featureType - FeatureType of the Feature
properties - properties (content) of the Feature
Returns:
instance of a Feature

createFeature

public static Feature createFeature(java.lang.String id,
                                    FeatureType featureType,
                                    FeatureProperty[] properties)
creates an instance of a Feature from its FeatureType and an array of Objects that represents it properties. It is assumed that the order of the properties is identical to the order of the FeatureTypeProperties of the the FeatureType.

Parameters:
id - unique id of the Feature
featureType - FeatureType of the Feature
properties - properties (content) of the Feature
Returns:
instance of a Feature

createFeature

public static Feature createFeature(GMLFeature gmlFeature)
creates an instance of a Feature from its FeatureType and a GMLFeature that contains the features data.

Parameters:
gmlFeature - instance of a GMLFeature
Returns:
instance of a Feature

getType

private static java.lang.String getType(int t)
returns the name of the (toplevel)class that is assigned to the submitted GML property type.

Parameters:
t - GML property type

createFeatureCollection

public static FeatureCollection createFeatureCollection(java.lang.String id,
                                                        FeatureType featureType,
                                                        FeatureProperty[] properties,
                                                        int initialCapacity)
creates an instance of a FeatureCollection with an initial capacity and a defined featuretype.

Parameters:
id - unique id of the FeatureCollection
featureType - FeatureType of the Feature
properties - properties (content) of the Feature
initialCapacity - initial capacity of the FeatureCollection
Returns:
instance of an empty FeatureCollection

createFeatureCollection

public static FeatureCollection createFeatureCollection(java.lang.String id,
                                                        int initialCapacity)
creates an instance of a FeatureCollection with an initial capacity. The returned FeatureCollection doesn't have a FeatureType nor properties. It is just a collection of Features.

Parameters:
id - unique id of the FeatureCollection
initialCapacity - initial capacity of the FeatureCollection
Returns:
instance of an empty FeatureCollection

createFeatureCollection

public static FeatureCollection createFeatureCollection(java.lang.String id,
                                                        Feature[] features)
creates an instance of a FeatureCollection from an array of Features. The returned FeatureCollection doesn't have a FeatureType nor properties. It is just a collection of Features.

Parameters:
id - unique id of the FeatureCollection instance
features - Features to fill in into the FeatureCollection
Returns:
instance of a FeatureCollection containing the submitted features

createFeatureCollection

public static FeatureCollection createFeatureCollection(GMLFeatureCollection gmlFc)
                                                 throws java.lang.Exception
creates an instance of a FeatureCollection from a GMLFeatureCollection

Parameters:
gmlFc - GMLFeatureCollection to create the FeatureCollection instance from
Returns:
instance of a FeatureCollection
Throws:
java.lang.Exception - -