Class FieldType

All Implemented Interfaces:
Serializable, Deprecable
Direct Known Subclasses:
DefaultAssociationRole, DefaultAttributeType

abstract class FieldType extends AbstractIdentifiedType
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 Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • minimumOccurs

      private final int minimumOccurs
      The minimum number of occurrences of the property within its containing entity.
    • maximumOccurs

      private final int maximumOccurs
      The maximum number of occurrences of the property within its containing entity, or Integer.MAX_VALUE if there is no limit.
  • Constructor Details

    • FieldType

      FieldType(Map<String,?> identification, int minimumOccurs, int maximumOccurs)
      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, or Integer.MAX_VALUE if 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 the getMinimumOccurs() value. If there is no maximum, then this method returns Integer.MAX_VALUE.
      Returns:
      the maximum number of occurrences of the property within its containing entity, or Integer.MAX_VALUE if none.
    • hashCode

      public int hashCode()
      Returns a hash code value for this property type.
      Overrides:
      hashCode in class AbstractIdentifiedType
      Returns:
      the hash code for this type.
    • equals

      public boolean equals(Object obj)
      Compares this property type with the given object for equality.
      Overrides:
      equals in class AbstractIdentifiedType
      Parameters:
      obj - the object to compare with this type.
      Returns:
      true if 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 of PropertyType.toString() methods. Example:
      Parameters:
      deprecated - whether the type to format is deprecated.
      className - the interface name of the object on which toString() is invoked.
      name - the property type name, sometimes AbstractIdentifiedType.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 of Property.toString() methods. Example:
      Parameters:
      deprecated - whether the type to format is deprecated.
      className - the interface name of the object on which toString() is invoked.
      name - the property type name, sometimes AbstractIdentifiedType.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.