com.vividsolutions.jump.feature
Class FeatureSchema

java.lang.Object
  extended bycom.vividsolutions.jump.feature.FeatureSchema
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
AttributeMapping.CombinedSchema

public class FeatureSchema
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Metadata for a FeatureCollection: attribute names and types.

See Also:
FeatureCollection, Serialized Form

Constructor Summary
FeatureSchema()
           
 
Method Summary
 void addAttribute(java.lang.String attributeName, AttributeType attributeType)
          Adds an attribute with the given case-sensitive name.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object other)
          Returns whether the two FeatureSchemas have the same attribute names with the same types and in the same order.
 boolean equals(java.lang.Object other, boolean orderMatters)
          Returns whether the two FeatureSchemas have the same attribute names with the same types and (optionally) in the same order.
 int getAttributeCount()
          Returns the total number of spatial and non-spatial attributes in this FeatureSchema.
 int getAttributeIndex(java.lang.String attributeName)
          Returns the zero-based index of the attribute with the given name (case-sensitive)
 java.lang.String getAttributeName(int attributeIndex)
          Returns the (case-sensitive) name of the attribute at the given zero-based index.
 AttributeType getAttributeType(int attributeIndex)
          Returns whether the attribute at the given zero-based index is a string, integer, double, etc.
 AttributeType getAttributeType(java.lang.String attributeName)
          Returns whether the attribute with the given name (case-sensitive) is a string, integer, double, etc.
 CoordinateSystem getCoordinateSystem()
           
 int getGeometryIndex()
          Returns the attribute index of the Geometry, or -1 if there is no Geometry attribute
 boolean hasAttribute(java.lang.String attributeName)
          Returns whether this FeatureSchema has an attribute with this name
 FeatureSchema setCoordinateSystem(CoordinateSystem coordinateSystem)
          Sets the CoordinateSystem associated with this FeatureSchema, but does not perform any reprojection.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureSchema

public FeatureSchema()
Method Detail

clone

public java.lang.Object clone()

getAttributeIndex

public int getAttributeIndex(java.lang.String attributeName)
Returns the zero-based index of the attribute with the given name (case-sensitive)

Throws:
java.lang.IllegalArgumentException - if attributeName is unrecognized

hasAttribute

public boolean hasAttribute(java.lang.String attributeName)
Returns whether this FeatureSchema has an attribute with this name

Parameters:
attributeName - the name to look up
Returns:
whether this FeatureSchema has an attribute with this name

getGeometryIndex

public int getGeometryIndex()
Returns the attribute index of the Geometry, or -1 if there is no Geometry attribute


getAttributeName

public java.lang.String getAttributeName(int attributeIndex)
Returns the (case-sensitive) name of the attribute at the given zero-based index.


getAttributeType

public AttributeType getAttributeType(int attributeIndex)
Returns whether the attribute at the given zero-based index is a string, integer, double, etc.


getAttributeType

public AttributeType getAttributeType(java.lang.String attributeName)
Returns whether the attribute with the given name (case-sensitive) is a string, integer, double, etc.


getAttributeCount

public int getAttributeCount()
Returns the total number of spatial and non-spatial attributes in this FeatureSchema. There are 0 or 1 spatial attributes and 0 or more non-spatial attributes.


addAttribute

public void addAttribute(java.lang.String attributeName,
                         AttributeType attributeType)
Adds an attribute with the given case-sensitive name.

Throws:
AssertionFailedException - if a second Geometry is being added

equals

public boolean equals(java.lang.Object other)
Returns whether the two FeatureSchemas have the same attribute names with the same types and in the same order.


equals

public boolean equals(java.lang.Object other,
                      boolean orderMatters)
Returns whether the two FeatureSchemas have the same attribute names with the same types and (optionally) in the same order.


setCoordinateSystem

public FeatureSchema setCoordinateSystem(CoordinateSystem coordinateSystem)
Sets the CoordinateSystem associated with this FeatureSchema, but does not perform any reprojection.

Returns:
this FeatureSchema

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
See Also:
setCoordinateSystem(CoordinateSystem)