|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.feature.FeatureFactoryImpl
Implementaton of *just* FeatureFactory for use by a FeatureType instance.
The only thing this class does is create features according to the provided schema. Schemas can not change after being edited, so the fact that the feature has a reference to its schema is not a problem.
Notes on the use of Index with respect to type inheritence: Given the above actual decision we can provide a consistence "index" for each attribute type in a single in heiritence feature type heirarchy. An index associated with a parent will indicate the location in the create value list for information for itself and all child types.
Multiple inheiritence is not considered by this FeatureFactoryImpl, to do multiple inheritence cannot be consistently defined using our existing API. However some things are clear for next time when we actualy do set up multiple inheritence. AttributeType overrides restrictions are still combined with AND, conflicts between attributes from different parents are where the trouble is at. The only answer is to kill the index idea, and force everyone to use real AttributeTypes to look up their information (aka strongly typed index).
Recomendations:
I recommend that we provide the AttributeType based lookup, and deprecate the index methods for the Geotools 2.1 timeframe.
This would allow us to provide type safty now, and allow us to to multiple inheirtience in the Geotools 2.2 timeframe
when the index methods are used. (This recomendation is based on a lost attempt at multiple inheirtence, one really cannot
produce a consistent implementation based on index).
Constructor Summary | |
FeatureFactoryImpl()
|
Method Summary | |
Feature |
create(FeatureType schema,
AttributeType[] type,
java.lang.Object[] value)
AttributeType typesafe Feature creations. |
Feature |
create(FeatureType flatSchema,
java.lang.Object[] values)
Convience method for FlatFeatureType for feature creation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FeatureFactoryImpl()
Method Detail |
public Feature create(FeatureType schema, AttributeType[] type, java.lang.Object[] value)
FeatureFactory2
This is option one, it works for both FeatureType and FlatFeatureType. Duplicate AttributeType are of course allowed (as long as the provided FeatureType supports this).
create
in interface FeatureFactory2
type
- List of AttributeType in creation ordervalue
- List of attribute value in creation order
public Feature create(FeatureType flatSchema, java.lang.Object[] values)
FeatureFactory2
This is a convience method to ease the transition phase for developers making use of a FlatFeatureType.
The use of this method should be considered to be *exactly* the same as:
factory.create( flatSchema, flatSchema.getAttributeTypes(), values );
A you can see this is only valid for FlatFeature schema in which the
results of getAttributeTypes() describes all the parameters required
for creation. For most shape and database base content this is a valid
assumption.
create
in interface FeatureFactory2
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |