This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
magik-demo:developer:class:core:term [2013/07/18 11:04] alex [applySubstitution] |
magik-demo:developer:class:core:term [2017/07/06 15:24] (current) |
||
---|---|---|---|
Line 5: | Line 5: | ||
Class for the definition a Term. Term managing all the functions for Terms.\\ | Class for the definition a Term. Term managing all the functions for Terms.\\ | ||
+ | |||
+ | {{ :magik-demo:developer:schema2.png?nolink&600 |}} | ||
+ | |||
Term essentially is a String that can be: | Term essentially is a String that can be: | ||
* //Variable// -> It must start with an **upper case** character (e.g. X, Y, Z) | * //Variable// -> It must start with an **upper case** character (e.g. X, Y, Z) | ||
Line 22: | Line 25: | ||
</code> | </code> | ||
Constructor.\\ | Constructor.\\ | ||
+ | |||
//Called by:// | //Called by:// | ||
* it.unibz.inf.magik.core.Atom | * it.unibz.inf.magik.core.Atom | ||
Line 41: | Line 45: | ||
java.util.HashMap<Term,Term> substitution) | java.util.HashMap<Term,Term> substitution) | ||
</code> | </code> | ||
- | Apply to the terms substitution.\\ | + | Apply to the terms substitution. |
**Parameters:** | **Parameters:** | ||
* terms - original terms | * terms - original terms | ||
Line 56: | Line 61: | ||
java.util.HashMap<Term,Term> substitution) | java.util.HashMap<Term,Term> substitution) | ||
</code> | </code> | ||
- | Apply to a term substitution.\\ | + | Apply to a term substitution. |
**Parameters:** | **Parameters:** | ||
* term - original term | * term - original term | ||
Line 73: | Line 79: | ||
**Returns:** | **Returns:** | ||
- | * true, if the term is a variable, false otherwise | + | * //true//, if the term is a variable, //false// otherwise |
- | + | ||
---- | ---- | ||
Line 84: | Line 91: | ||
**Returns:** | **Returns:** | ||
- | * true, if the term is a constant, false otherwise | + | * //true//, if the term is a constant, //false// otherwise |
- | + | ||
---- | ---- | ||
+ | ==== clone ==== | ||
+ | <code java> | ||
+ | @Override | ||
+ | public Object clone () | ||
+ | </code> | ||
+ | |||
+ | **Returns:** | ||
+ | * cloned object (Term type) | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== equals ==== | ||
+ | <code java> | ||
+ | @Override | ||
+ | public boolean equals (Object o) | ||
+ | </code> | ||
+ | |||
+ | Implementation for checking the equality for Term | ||
+ | |||
+ | **Returns:** | ||
+ | * //true// if equal, //false// otherwise | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== toString ==== | ||
+ | <code java> | ||
+ | @Override | ||
+ | public String toString () | ||
+ | </code> | ||
+ | |||
+ | Implementation for converting in String format Term.\\ | ||
+ | This because it has to be respect the variable or constant format. | ||
+ | |||
+ | **Returns:** | ||
+ | * String version of the Term | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== getters and setters methods ==== | ||
+ | <code java> | ||
+ | public java.lang.getTerm() | ||
+ | public void setTerm(java.lang.String term) | ||
+ | </code> | ||
+ | |||
+ | [[magik-demo:developer:class:core:term|Back to Top]] | [[magik-demo:start|Back to Home Page]] |