public class DefaultAssociationRole extends AbstractIdentifiedType
GenericName
and InternationalString
instances) and all arguments (e.g. valueType
) given to the constructor are also immutable.
Such immutable instances can be shared by many objects and passed between threads without synchronization.AbstractAssociation
,
Serialized FormDefined in the sis-feature
module
DEFINITION_KEY, DESCRIPTION_KEY, DESIGNATION_KEY, NAME_KEY
Constructor and Description |
---|
DefaultAssociationRole(Map<String,?> identification,
DefaultFeatureType valueType,
int minimumOccurs,
int maximumOccurs)
Constructs an association to the given feature type.
|
DefaultAssociationRole(Map<String,?> identification,
GenericName valueType,
int minimumOccurs,
int maximumOccurs)
Constructs an association to a feature type of the given name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares this association role with the given object for equality.
|
int |
getMaximumOccurs()
Returns the maximum number of occurrences of the association within its containing entity.
|
int |
getMinimumOccurs()
Returns the minimum number of occurrences of the association within its containing entity.
|
DefaultFeatureType |
getValueType()
Returns the type of feature values.
|
int |
hashCode()
Returns a hash code value for this association role.
|
AbstractAssociation |
newInstance()
Creates a new association instance of this role.
|
String |
toString()
Returns a string representation of this association role.
|
getDefinition, getDescription, getDesignation, getName
public DefaultAssociationRole(Map<String,?> identification, DefaultFeatureType valueType, int minimumOccurs, int maximumOccurs)
Map key | Value type | Returned by |
---|---|---|
"name" | GenericName or String |
AbstractIdentifiedType.getName() |
"definition" | InternationalString or String |
AbstractIdentifiedType.getDefinition() |
"designation" | InternationalString or String |
AbstractIdentifiedType.getDesignation() |
"description" | InternationalString or String |
AbstractIdentifiedType.getDescription() |
identification
- The name and other information to be given to this association role.valueType
- The type of feature values.minimumOccurs
- The minimum number of occurrences of the association within its containing entity.maximumOccurs
- The maximum number of occurrences of the association within its containing entity,
or Integer.MAX_VALUE
if there is no restriction.public DefaultAssociationRole(Map<String,?> identification, GenericName valueType, int minimumOccurs, int maximumOccurs)
DefaultFeatureType
instances.
In such cases, at least one association needs to be created while its FeatureType
is not yet available.
After the above code completed, the value type of "association to B" has been automatically set to theString namespace = "My model"; GenericName nameOfA = Names.createTypeName(namespace, ":", "Feature type A"); GenericName nameOfB = Names.createTypeName(namespace, ":", "Feature type B"); FeatureType typeA = new DefaultFeatureType(nameOfA, false, null, new DefaultAssociationRole(Names.createLocalName("Association to B"), nameOfB), // More properties if desired. ); FeatureType typeB = new DefaultFeatureType(nameOfB, false, null, new DefaultAssociationRole(Names.createLocalName("Association to A"), featureA), // More properties if desired. );
typeB
instance.
FeatureType
instance of the given name is found at resolution time, the selected one
is undetermined.identification
- The name and other information to be given to this association role.valueType
- The name of the type of feature values.minimumOccurs
- The minimum number of occurrences of the association within its containing entity.maximumOccurs
- The maximum number of occurrences of the association within its containing entity,
or Integer.MAX_VALUE
if there is no restriction.public final DefaultFeatureType getValueType()
org.opengis.feature.FeatureType
. This change is pending GeoAPI revision.IllegalStateException
- if the feature type has been specified
only by its name
and not yet resolved.public final int getMinimumOccurs()
public final int getMaximumOccurs()
getMinimumOccurs()
value.
If there is no maximum, then this method returns Integer.MAX_VALUE
.Integer.MAX_VALUE
if none.public AbstractAssociation newInstance()
AbstractAssociation#create(FeatureAssociationRole)
public int hashCode()
public boolean equals(Object obj)
obj
- The object to compare with this type.true
if the given object is equals to this type.Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.