Package org.apache.sis.feature
Class FieldType
java.lang.Object
org.apache.sis.feature.AbstractIdentifiedType
org.apache.sis.feature.FieldType
- All Implemented Interfaces:
Serializable,Deprecable
- Direct Known Subclasses:
DefaultAssociationRole,DefaultAttributeType
Base class of property types having a value and a multiplicity.
This include
AttributeType and AssociationRole, but not Operation.
Analogy: if we compare
FeatureType to a class in the Java language,
attributes and associations would be fields while operations would be methods. This analogy explains
the FieldType name of this class.- Since:
- 0.5
- Version:
- 0.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe maximum number of occurrences of the property within its containing entity, orInteger.MAX_VALUEif there is no limit.private final intThe minimum number of occurrences of the property within its containing entity.private static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.feature.AbstractIdentifiedType
DEFINITION_KEY, deprecated, DEPRECATED_KEY, DESCRIPTION_KEY, DESIGNATION_KEY, NAME_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this property type with the given object for equality.intReturns the maximum number of occurrences of the property within its containing entity.intReturns the minimum number of occurrences of the property within its containing entity.inthashCode()Returns a hash code value for this property type.(package private) static StringBuilderHelper method for implementation ofPropertyType.toString()methods.(package private) static StringBuildertoString(boolean deprecated, String className, org.opengis.util.GenericName name, Object valueType, Iterator<?> values) Helper method for implementation ofProperty.toString()methods.Methods inherited from class org.apache.sis.feature.AbstractIdentifiedType
createName, getDefinition, getDescription, getDesignation, getName, getRemarks, isDeprecated, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
minimumOccurs
private final int minimumOccursThe minimum number of occurrences of the property within its containing entity. -
maximumOccurs
private final int maximumOccursThe maximum number of occurrences of the property within its containing entity, orInteger.MAX_VALUEif there is no limit.
-
-
Constructor Details
-
FieldType
Constructs a field type from the given properties. The identification map is given unchanged to the super-class constructor.- Parameters:
identification- the name and other information to be given to this field type.minimumOccurs- the minimum number of occurrences of the property within its containing entity.maximumOccurs- the maximum number of occurrences of the property within its containing entity, orInteger.MAX_VALUEif there is no restriction.
-
-
Method Details
-
getMinimumOccurs
public int getMinimumOccurs()Returns the minimum number of occurrences of the property within its containing entity. The returned value is greater than or equal to zero.- Returns:
- the minimum number of occurrences of the property within its containing entity.
-
getMaximumOccurs
public int getMaximumOccurs()Returns the maximum number of occurrences of the property within its containing entity. The returned value is greater than or equal to thegetMinimumOccurs()value. If there is no maximum, then this method returnsInteger.MAX_VALUE.- Returns:
- the maximum number of occurrences of the property within its containing entity,
or
Integer.MAX_VALUEif none.
-
hashCode
public int hashCode()Returns a hash code value for this property type.- Overrides:
hashCodein classAbstractIdentifiedType- Returns:
- the hash code for this type.
-
equals
Compares this property type with the given object for equality.- Overrides:
equalsin classAbstractIdentifiedType- Parameters:
obj- the object to compare with this type.- Returns:
trueif the given object is equal to this type.
-
toString
static StringBuilder toString(boolean deprecated, String className, org.opengis.util.GenericName name, Object valueType) Helper method for implementation ofPropertyType.toString()methods. Example:- Parameters:
deprecated- whether the type to format is deprecated.className- the interface name of the object on whichtoString()is invoked.name- the property type name, sometimesAbstractIdentifiedType.getName()or sometimes the name of another object.valueType- the name of value class (attribute), or the feature type name (association).
-
toString
static StringBuilder toString(boolean deprecated, String className, org.opengis.util.GenericName name, Object valueType, Iterator<?> values) Helper method for implementation ofProperty.toString()methods. Example:- Parameters:
deprecated- whether the type to format is deprecated.className- the interface name of the object on whichtoString()is invoked.name- the property type name, sometimesAbstractIdentifiedType.getName()or sometimes the name of another object.valueType- the name of value class (attribute), or the feature type name (association).values- the actual values.
-