Class Type

  • All Implemented Interfaces:
    java.io.Serializable

    public class Type
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • Type

        public Type​(java.lang.String name)
    • Method Detail

      • getName

        public java.lang.String getName()
      • addSubType

        public void addSubType​(Type newSubType)
      • removeSubType

        public void removeSubType​(Type removeSubType)
      • getDirectSubTypes

        public java.util.List<Type> getDirectSubTypes()
      • getAllSubTypes

        public java.util.List<Type> getAllSubTypes()
      • getAllSubTypesIncl

        public java.util.List<Type> getAllSubTypesIncl()
      • addSuperType

        public void addSuperType​(Type newSuperType)
      • removeSuperType

        public void removeSuperType​(Type removeSuperType)
      • getDirectSuperTypes

        public java.util.List<Type> getDirectSuperTypes()
      • isRootType

        public boolean isRootType()
      • isSuperTypeOf

        public boolean isSuperTypeOf​(Type typeToCheck)
        Given the parameter typeToCheck, this method checks whether typeToCheck is actually a sub type of the current object. Thus, it checks whether this is a super type of typeToCheck.
        Parameters:
        typeToCheck - A DataType to check whether it is a sub-type of this DataType.
        Returns:
        It returns true iff the given DataType typeToCheck is a sub-type of this DataType.
      • isSubTypeOf

        public boolean isSubTypeOf​(Type typeToCheck)
        Given the parameter typeToCheck, this method checks whether typeToCheck is actually a super type of the current object. Thus, it checks whether this is a sub type of typeToCheck.
        Parameters:
        typeToCheck - A DataType to check whether it is a super type of this DataType
        Returns:
        It returns true iff the given DataType typeToCheck is a super type of this DataType.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addSuperType

        public void addSuperType​(java.util.Set<Type> parentTypeCollection)
      • getGreatestSubType

        public static Type getGreatestSubType​(Type type,
                                              Type type2)
        Searches in data type DAG for a greatest sub type of the given two types.
        Parameters:
        type - Type to check for sub type relation.
        type2 - Type to check for sub type relation.
        Returns:
        Returns the concreter type if the two types are related to each other. Otherwise, it returns null.
      • getInheritanceHierarchyIncludingType

        public java.util.List<Type> getInheritanceHierarchyIncludingType()
      • getConcretesHierarchyIncludingType

        public java.util.List<Type> getConcretesHierarchyIncludingType()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • getAllSuperTypes

        public java.util.List<Type> getAllSuperTypes()
      • getAllSuperTypesIncl

        public java.util.List<Type> getAllSuperTypesIncl()
      • serialize

        public java.lang.String serialize()