Class TermUtils
java.lang.Object
org.projog.core.term.TermUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertType(Term t, TermType type) static voidBacktracks allTerms in the specified array.static Numericstatic Term[]Returns copies of the specified {link Term}sgetAllVariablesInTerm(Term argument) Returns allVariables contained in the specified term.private static voidgetAllVariablesInTerm(Term argument, Set<Variable> variables) static StringgetAtomName(Term t) static booleantermsEqual(Term a, Term b) static intstatic longtoLong(ArithmeticOperators operators, Term t) Return the long value represented by the specified term.static booleanAttempts to unify all correspondingTerms in the specified arrays.
-
Field Details
-
EMPTY_ARRAY
-
-
Constructor Details
-
TermUtils
private TermUtils()Private constructor as all methods are static.
-
-
Method Details
-
copy
-
backtrack
-
unify
Attempts to unify all correspondingTerms in the specified arrays.Note: If the attempt to unify the corresponding terms is unsuccessful only the terms in
queryArgswill get backtracked.- Parameters:
queryArgs- terms to unify withconsequentArgsconsequentArgs- terms to unify withqueryArgs- Returns:
trueif the attempt to unify all corresponding terms was successful
-
getAllVariablesInTerm
-
getAllVariablesInTerm
-
castToNumeric
-
toInt
-
toLong
Return the long value represented by the specified term.- Parameters:
t- the term representing a long value- Returns:
- the
longvalue represented byt - Throws:
ProjogException- if the specifiedTermdoes not represent a term of typeTermType.INTEGER
-
getAtomName
-
assertType
-
termsEqual
-