Class TypedStructureAdapter
java.lang.Object
org.tweetyproject.logics.commons.syntax.TypedStructureAdapter
- All Implemented Interfaces:
Comparable<TypedStructureAdapter>,TypedStructure
public abstract class TypedStructureAdapter
extends Object
implements TypedStructure, Comparable<TypedStructureAdapter>
The abstract parent for predicates and functors implementing the
TypedStructure interface. This class implements their common
functionalities.
- Author:
- Matthias Thimm, Tim Janus
-
Constructor Summary
ConstructorsConstructorDescriptionDefault-Ctor: Creating empty typed structureTypedStructureAdapter(String name) Initializes a structure of arity zero with the given name;TypedStructureAdapter(String name, int arity) Initializes a structure with the given name and of the given arity.TypedStructureAdapter(String name, List<Sort> arguments) Initializes a structure with the given name and the given list of argument sorts. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgumentType(Sort argType) Adds the given Sort as argument type to the typed Structureabstract TypedStructureclone()Creates a deep copy of this objectintbooleanintgetArity()getName()inthashCode()booleanbooleanisTyped()removeArgumentType(int index) Removes the argument type at the specified indexbooleanremoveArgumentType(Sort argType) Removes the given Sort from the list of argument typesvoidChanges the name of the StructuretoString()
-
Constructor Details
-
TypedStructureAdapter
public TypedStructureAdapter()Default-Ctor: Creating empty typed structure -
TypedStructureAdapter
Initializes a structure of arity zero with the given name;- Parameters:
name- the name of the structure
-
TypedStructureAdapter
Initializes a structure with the given name and of the given arity. Every argument gets the sort Sort.THING.- Parameters:
name- the name of the structurearity- the arity of this structure
-
TypedStructureAdapter
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceTypedStructure- Returns:
- the unique name of the structure
-
setName
Description copied from interface:TypedStructureChanges the name of the Structure- Specified by:
setNamein interfaceTypedStructure- Parameters:
name- The new name of the structure
-
getArity
public int getArity()- Specified by:
getArityin interfaceTypedStructure- Returns:
- the arity of this structure
-
getArgumentTypes
- Specified by:
getArgumentTypesin interfaceTypedStructure- Returns:
- An unmodifiable list which length equals the arity of the predicate if the structure isComplete().
-
addArgumentType
Description copied from interface:TypedStructureAdds the given Sort as argument type to the typed Structure- Specified by:
addArgumentTypein interfaceTypedStructure- Parameters:
argType- The Sort descibing the argument type
-
removeArgumentType
Description copied from interface:TypedStructureRemoves the argument type at the specified index- Specified by:
removeArgumentTypein interfaceTypedStructure- Parameters:
index- The index- Returns:
- A reference to the sort that has been remove or null if no sort has been removed.
-
removeArgumentType
Description copied from interface:TypedStructureRemoves the given Sort from the list of argument types- Specified by:
removeArgumentTypein interfaceTypedStructure- Parameters:
argType- The Sort which is removed- Returns:
- true if the Sort exists in the list of argument types and is successfully removed, false otherwise.
-
isTyped
public boolean isTyped()- Specified by:
isTypedin interfaceTypedStructure- Returns:
- true if at least one sort for an argument is not "Thing".
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfaceTypedStructure- Returns:
- true if the arity of this structure matches the length of it's arguments, false if the arity is bigger than the length of it's arguments.
-
toString
-
hashCode
-
equals
-
clone
Description copied from interface:TypedStructureCreates a deep copy of this object- Specified by:
clonein interfaceTypedStructure- Returns:
- A deep copy of this object
-
compareTo
- Specified by:
compareToin interfaceComparable<TypedStructureAdapter>
-