public class Atom
extends java.lang.Object
Constructor and Description |
---|
Atom(Atom atom)
Creates a copy of a given
|
Atom(AtomType type)
Constructor:
|
Atom(java.util.List<Term> terms)
Constructor: a set of terms is required.
|
Modifier and Type | Method and Description |
---|---|
void |
addTerm(Term term)
Adds a term to the atom.
|
Term |
findArgument1Term()
Returns Argument1 term if it exists.
|
Term |
findArgument2Term()
Returns Argument2 term if it exists.
|
Term |
findCalledTerm()
Returns Called term if it exists.
|
Term |
findEqualTerm(Term equal)
Finds exactly the same term as the given one.
|
Term |
findObjectTerm()
Returns Object term if it exists.
|
Term |
findPredicateTerm()
Returns Predicate term if it exists.
|
Term |
findSimilarTerm(Term similar)
Finds similar term as the given one, i.e., a term which has the same value, is variable and has the same value type, but it can be of different
|
Term |
findSQLCommandTerm()
Returns SQLCommand term if it exists.
|
Term |
findSubjectTerm()
Returns Subject term if it exists.
|
Term |
findTermByType(TermType type)
Returns any term if it exists.
|
java.util.List<Term> |
getTerms()
Returns terms in the atom.
|
AtomType |
getType()
Returns the
|
java.lang.String |
prettyPrint()
Returns
|
void |
removeTerm(Term term)
Removes the selected term from the list of terms
|
void |
sortTerms()
Sorts terms in an appropriate order: Subject, Predicate, Object, Argument1, Argument2, SQLCommandTerm
|
java.lang.String |
toString() |
public Atom(Atom atom)
atom
- public Atom(AtomType type)
type
- public Atom(java.util.List<Term> terms)
terms
- public void addTerm(Term term)
term
- public Term findArgument1Term()
public Term findArgument2Term()
public Term findCalledTerm()
public Term findEqualTerm(Term equal)
equal
- public Term findObjectTerm()
public Term findPredicateTerm()
public Term findSimilarTerm(Term similar)
equal
- public Term findSQLCommandTerm()
public Term findSubjectTerm()
public Term findTermByType(TermType type)
type
- public java.util.List<Term> getTerms()
public AtomType getType()
public java.lang.String prettyPrint()
public void removeTerm(Term term)
term
- public void sortTerms()
public java.lang.String toString()
toString
in class java.lang.Object