Class Type
- java.lang.Object
-
- ai.libs.jaicore.logic.fol.structure.Type
-
- All Implemented Interfaces:
java.io.Serializable
public class Type extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Type(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubType(Type newSubType)
void
addSuperType(Type newSuperType)
void
addSuperType(java.util.Set<Type> parentTypeCollection)
boolean
equals(java.lang.Object o)
java.util.List<Type>
getAllSubTypes()
java.util.List<Type>
getAllSubTypesIncl()
java.util.List<Type>
getAllSuperTypes()
java.util.List<Type>
getAllSuperTypesIncl()
java.util.List<Type>
getConcretesHierarchyIncludingType()
java.util.List<Type>
getDirectSubTypes()
java.util.List<Type>
getDirectSuperTypes()
static Type
getGreatestSubType(Type type, Type type2)
Searches in data type DAG for a greatest sub type of the given two types.java.util.List<Type>
getInheritanceHierarchyIncludingType()
java.lang.String
getName()
int
hashCode()
boolean
isRootType()
boolean
isSubTypeOf(Type typeToCheck)
Given the parameter typeToCheck, this method checks whether typeToCheck is actually a super type of the current object.boolean
isSuperTypeOf(Type typeToCheck)
Given the parameter typeToCheck, this method checks whether typeToCheck is actually a sub type of the current object.void
removeSubType(Type removeSubType)
void
removeSuperType(Type removeSuperType)
java.lang.String
serialize()
java.lang.String
toString()
-
-
-
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 classjava.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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
getAllSuperTypes
public java.util.List<Type> getAllSuperTypes()
-
getAllSuperTypesIncl
public java.util.List<Type> getAllSuperTypesIncl()
-
serialize
public java.lang.String serialize()
-
-