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:atom [2013/07/18 14:32] alex [isVariable] |
magik-demo:developer:class:core:atom [2017/07/06 15:24] (current) |
||
---|---|---|---|
Line 5: | Line 5: | ||
Class for the definition an Atom. Atom managing all the functions for atoms.\\ | Class for the definition an Atom. Atom managing all the functions for atoms.\\ | ||
+ | |||
+ | {{ :magik-demo:developer:schema2.png?nolink&600 |}} | ||
+ | |||
===== Class Attributes ===== | ===== Class Attributes ===== | ||
Line 14: | Line 17: | ||
</code> | </code> | ||
- | ===== Class Constructor ===== | + | ===== Class Constructors ===== |
==== Atom ==== | ==== Atom ==== | ||
Line 231: | Line 234: | ||
Check if the Atom contains a term. | Check if the Atom contains a term. | ||
+ | **Parameters:** | ||
+ | * term - term that we want to find | ||
**Returns:** | **Returns:** | ||
- | * //true//, if the atom contains a term , //false// otherwise | + | * //true//, if the atom contains the term , //false// otherwise |
---- | ---- | ||
- | ==== isConstant ==== | + | |
+ | ==== replaceTerm ==== | ||
<code java> | <code java> | ||
- | public static boolean isConstant () | + | public void replaceTerm(java.lang.String oldTerm, |
+ | java.lang.String newTerm) | ||
+ | </code> | ||
+ | Replace term with a new string (if old string is found in the atom). | ||
+ | |||
+ | **Parameters:** | ||
+ | * oldTerm - the term that is candidated to be replace | ||
+ | * newTerm - the new term | ||
+ | |||
+ | |||
+ | ---- | ||
+ | ==== clone ==== | ||
+ | <code java> | ||
+ | @Override | ||
+ | public Object clone () | ||
</code> | </code> | ||
- | Check if the term is a constant.\\ | ||
**Returns:** | **Returns:** | ||
- | * //true//, if the term is a constant, //false// otherwise | + | * cloned object (Atom type) |
---- | ---- | ||
+ | |||
+ | ==== equals ==== | ||
+ | <code java> | ||
+ | @Override | ||
+ | public boolean equals (Object o) | ||
+ | </code> | ||
+ | |||
+ | Implementation for checking the equality for Atom | ||
+ | |||
+ | **Returns:** | ||
+ | * //true// if equal, //false// otherwise | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== toString ==== | ||
+ | <code java> | ||
+ | @Override | ||
+ | public String toString () | ||
+ | </code> | ||
+ | |||
+ | Implementation for converting in String format Atom. | ||
+ | |||
+ | **Returns:** | ||
+ | * String version of the atom | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== getters and setters methods ==== | ||
+ | <code java> | ||
+ | public long getAtomId() | ||
+ | public void setAtomId(long atomId) | ||
+ | |||
+ | public java.lang.String getAtomName() | ||
+ | public void setAtomName(java.lang.StringString atomName) | ||
+ | |||
+ | public java.util.StringArrayList<Term> getTerms() | ||
+ | public void setTerms(java.util.ArrayList<Term> terms) | ||
+ | |||
+ | </code> | ||
+ | |||
+ | [[magik-demo:developer:class:core:atom|Back to Top]] | [[magik-demo:start|Back to Home Page]] |