public abstract class AbstractFeature extends Object implements Serializable
AbstractFeature
can be instantiated by calls to DefaultFeatureType.newInstance()
.
AbstractFeature
instances are not thread-safe.
Synchronization, if needed, shall be done externally by the caller.DefaultFeatureType.newInstance()
,
Serialized FormDefined in the sis-feature
module
Modifier | Constructor and Description |
---|---|
protected |
AbstractFeature(DefaultFeatureType type)
Creates a new feature of the given type.
|
Modifier and Type | Method and Description |
---|---|
abstract Object |
getProperty(String name)
Returns the property (attribute, feature association or operation result) of the given name.
|
abstract Object |
getPropertyValue(String name)
Returns the value for the property of the given name.
|
DefaultFeatureType |
getType()
Returns information about the feature (name, characteristics, etc.
|
DataQuality |
quality()
Evaluates the quality of this feature at this method invocation time.
|
abstract void |
setProperty(Object property)
Sets the property (attribute or feature association).
|
abstract void |
setPropertyValue(String name,
Object value)
Sets the value for the property of the given name.
|
String |
toString()
Formats this feature in a tabular format.
|
protected AbstractFeature(DefaultFeatureType type)
type
- Information about the feature (name, characteristics, etc.).DefaultFeatureType.newInstance()
public DefaultFeatureType getType()
org.opengis.feature.FeatureType
. This change is pending GeoAPI revision.public abstract Object getProperty(String name) throws IllegalArgumentException
org.opengis.feature.Property
. This change is pending GeoAPI revision.getPropertyValue(String)
is preferred since it gives to SIS a
chance to avoid the creation of AbstractAttribute
or AbstractAssociation
instances.name
- The property name.null
).IllegalArgumentException
- if the given argument is not a property name of this feature.getPropertyValue(String)
,
DefaultFeatureType.getProperty(String)
public abstract void setProperty(Object property) throws IllegalArgumentException
assert property.getType() == getType().getProperty(property.getName());
Attribute
or
FeatureAssociation
implementations in this feature. When default implementations are sufficient,
the setPropertyValue(String, Object)
method is preferred.org.opengis.feature.Property
. This change is pending GeoAPI revision.property
- The property to set.IllegalArgumentException
- if the name of the given property is not a property name of this feature.IllegalArgumentException
- if the value of the given property is not valid.IllegalArgumentException
- if the property can not be set for another reason.setPropertyValue(String, Object)
public abstract Object getPropertyValue(String name) throws IllegalArgumentException
getProperty(String)
for the given name,
then to perform one of the following actions depending on the property type and the cardinality:
Property type | max. occurs | Method invoked | Return type |
---|---|---|---|
AttributeType | 0 or 1 | Attribute#getValue() | Object |
AttributeType | 2 or more | Attribute#getValues() | Collection<?> |
FeatureAssociationRole | 0 or 1 | FeatureAssociation#getValue() | Feature |
FeatureAssociationRole | 2 or more | FeatureAssociation#getValues() | Collection<Feature> |
name
- The property name.null
if none.IllegalArgumentException
- if the given argument is not an attribute or association name of this feature.AbstractAttribute.getValue()
public abstract void setPropertyValue(String name, Object value) throws IllegalArgumentException
quality()
method.name
- The attribute name.value
- The new value for the given attribute (may be null
).IllegalArgumentException
- if the given name is not an attribute or association name of this feature.ClassCastException
- if the value is not assignable to the expected value class.IllegalArgumentException
- if the given value is not valid for a reason other than its type.AbstractAttribute.setValue(Object)
public DataQuality quality()
The default implementation reports data quality with at least the following information:
ScopeCode.FEATURE
.
AbstractAttribute.quality()
javadoc.
false
.
quality()
method will return the following data quality report:
Data quality ├─Scope │ └─Level………………………………………………… Feature └─Report ├─Measure identification │ └─Code………………………………………… population ├─Evaluation method type…… Direct internal └─Result ├─Explanation……………………… Missing value for “population” property. └─Pass………………………………………… false
AbstractAttribute.quality()
,
AbstractAssociation.quality()
public String toString()
toString
in class Object
FeatureFormat
Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.