T
- The type of the value saved in the term, this might be a string
if the term is a constant or a variable, or it might be an integer
if the term is a number term.public abstract class TermAdapter<T> extends java.lang.Object implements Term<T>
Modifier and Type | Field and Description |
---|---|
private Sort |
sort
the type of the term
|
protected T |
value |
Constructor and Description |
---|
TermAdapter(T value)
Default-Ctor: Creates an TermAdapter with the Sort "Thing"
|
TermAdapter(T value,
Sort sort)
Ctor: Creates a TermAdapter with the given Sort
|
Modifier and Type | Method and Description |
---|---|
abstract TermAdapter<?> |
clone()
Creates a deep copy of the term
|
<C extends Term<?>> |
containsTermsOfType(java.lang.Class<C> cls)
Checks if this logical structure contains at least one term of type C.
|
boolean |
equals(java.lang.Object obj) |
T |
get() |
Sort |
getSort() |
java.util.Set<Term<?>> |
getTerms() |
<C extends Term<?>> |
getTerms(java.lang.Class<C> cls)
Processes the set containing all terms of type C.
|
int |
hashCode() |
void |
set(T value)
Changes the java-object representation of the term to the
given value.
|
Term<?> |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this term
by term "t" and returns the new term.
|
java.lang.String |
toString() |
public TermAdapter(T value)
public java.util.Set<Term<?>> getTerms()
getTerms
in interface LogicStructure
public <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
LogicStructure
getTerms
in interface LogicStructure
cls
- The Class structure containing type information about the
searched termpublic <C extends Term<?>> boolean containsTermsOfType(java.lang.Class<C> cls)
LogicStructure
containsTermsOfType
in interface LogicStructure
cls
- The class structure representing the type C of the term.public Term<?> substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
Term
substitute
in interface Term<T>
v
- the term to be substituted.t
- the term to substitute.java.lang.IllegalArgumentException
- if "v" and "t" are of different sorts
(NOTE: this exception is only thrown when "v" actually appears in this
formula)public Sort getSort()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract TermAdapter<?> clone()
Term
public java.lang.String toString()
toString
in class java.lang.Object
public void set(T value)
Term