public class FeatureSchema
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
FeatureCollection
,
Serialized FormConstructor and Description |
---|
FeatureSchema() |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String attributeName,
AttributeType attributeType)
Adds an attribute with the given case-sensitive name.
|
void |
addDynamicAttribute(java.lang.String attributeName,
AttributeType attributeType,
Operation operation)
Add a dynamic attribute to this FeatureSchema
A dynamic attribute is a readOnly attribute which is dynamically
evaluated on demand.
|
void |
addExternalPrimaryKey(java.lang.String attributeName,
AttributeType attributeType)
Add an attribute containing an external identifier.
|
java.lang.Object |
clone()
Return a deep copy of this FeatureSchema.
|
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 |
getExternalPrimaryKeyIndex()
Returns the attribute index of the externalId attribute, or -1 if there is no
externalId.
|
int |
getGeometryIndex()
Returns the attribute index of the Geometry, or -1 if there is no
Geometry attribute
|
Operation |
getOperation(int attributeIndex)
Get the operation in charge of the attribute value evaluation.
|
boolean |
hasAttribute(java.lang.String attributeName)
Returns whether this FeatureSchema has an attribute with this name
|
boolean |
isAttributeReadOnly(int attributeIndex)
Returns the "readonly" status of the attribute specified by the
attributeIndex.
|
boolean |
isOperation(int attributeIndex)
Returns true if an attribute must be computed on the fly by an Operation.
|
void |
removeExternalPrimaryKey() |
void |
setAttributeReadOnly(int attributeIndex,
boolean isReadOnly)
Sets the "readonly" status of the attribute specified by the
attributeIndex.
|
FeatureSchema |
setCoordinateSystem(CoordinateSystem coordinateSystem)
Sets the CoordinateSystem associated with this FeatureSchema, but does
not perform any reprojection.
|
void |
setExternalPrimaryKeyIndex(int index) |
void |
setOperation(int attributeIndex,
Operation operation)
Set the Operation in charge of computing this attribute.
|
java.lang.String |
toString() |
public java.lang.Object clone()
clone
in class java.lang.Object
public int getAttributeIndex(java.lang.String attributeName)
java.lang.IllegalArgumentException
- if attributeName is unrecognizedpublic boolean hasAttribute(java.lang.String attributeName)
attributeName
- the name to look uppublic int getGeometryIndex()
public java.lang.String getAttributeName(int attributeIndex)
public AttributeType getAttributeType(int attributeIndex)
public AttributeType getAttributeType(java.lang.String attributeName)
public int getAttributeCount()
public void addAttribute(java.lang.String attributeName, AttributeType attributeType)
com.vividsolutions.jts.util.AssertionFailedException
- if a second Geometry is being addedpublic void addDynamicAttribute(java.lang.String attributeName, AttributeType attributeType, Operation operation)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean equals(java.lang.Object other, boolean orderMatters)
public FeatureSchema setCoordinateSystem(CoordinateSystem coordinateSystem)
public CoordinateSystem getCoordinateSystem()
public boolean isAttributeReadOnly(int attributeIndex)
attributeIndex
- The index of the attribute in question.setAttributeReadOnly(int, boolean)
public void setAttributeReadOnly(int attributeIndex, boolean isReadOnly)
attributeIndex
- The index of the attribute to setisReadOnly
- A flag that indicates whether the specified attribute should
be considered "readonly".isAttributeReadOnly(int)
public boolean isOperation(int attributeIndex)
attributeIndex
- The index of the attribute in question.public void setOperation(int attributeIndex, Operation operation)
attributeIndex
- index of the attribute to compute.operation
- operation in charge of the evaluation.public Operation getOperation(int attributeIndex)
attributeIndex
- index of the attribute.public int getExternalPrimaryKeyIndex()
public void setExternalPrimaryKeyIndex(int index)
public void removeExternalPrimaryKey()
public void addExternalPrimaryKey(java.lang.String attributeName, AttributeType attributeType)
attributeName
- name of the external idattributeType
- type of the external idjava.lang.IllegalArgumentException
- if the attributeType of the id is not one of
Integer, String or Object (for Long)public java.lang.String toString()
toString
in class java.lang.Object