Interface FeatureType

  • All Superinterfaces:

    public interface FeatureType
    extends IdentifiedType
    Abstraction of a real-world phenomena. A FeatureType instance describes the class of all Feature instances of that type.
    Analogy with Java reflection
    compared to the Java language, FeatureType is equivalent to Class while Feature instances are equivalent to Object instances of that class.


    The feature type name is mandatory and should be unique. Names can be ScopedName for avoiding name collision.

    Properties and inheritance

    Each feature type can provide descriptions for the following properties: In addition, a feature type can inherit the properties of one or more other feature types. Properties defined in the sub-type can override properties of the same name defined in the super-types, provided that values of the sub-type property are assignable to the super-type property.
    Analogy with Java language
    compared to the Java language, the above rule is similar to overriding a method with a more specific return type (a.k.a. covariant return type). This is also similar to Java arrays, which are implicitly covariant (i.e. String[] can be casted to CharSequence[], which is safe for read operations but not for write operations — the later may throw ArrayStoreException).
    See Also:
    • Method Detail

      • isSimple

        boolean isSimple()
        Returns true if this feature type contains only attributes constrained to the [1 … 1] cardinality, or operations (no feature association). Such feature types can be handled as a RecordType instances.
        true if this feature type contains only simple attributes or operations.
      • getProperties

        Collection<? extends PropertyType> getProperties​(boolean includeSuperTypes)
        Returns any feature operation, any feature attribute type and any feature association role that carries characteristics of a feature type. The returned collection will include the properties inherited from the super-types only if includeSuperTypes is true.
        includeSuperTypes - true for including the properties inherited from the super-types, or false for returning only the properties defined explicitely in this type.
        Feature operation, attribute type and association role that carries characteristics of this feature type (not including parent types).
      • isAssignableFrom

        boolean isAssignableFrom​(FeatureType type)
        Returns true if this type is same or a super-type of the given type.
        Analogy with Java reflection
        if we compare FeatureType to Class in the Java language, then this method is equivalent to Class.isAssignableFrom(Class).
        type - the type to be checked.
        true if instances of the given type can be assigned to association of this type.