Package org.projog.core.term
Class TermUtils
java.lang.Object
org.projog.core.term.TermUtils
Helper methods for performing common tasks on
Term instances.-
Field Summary
Fields -
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}sstatic 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.
-
Field Details
-
EMPTY_ARRAY
-
-
Method Details
-
copy
Returns copies of the specified {link Term}s- Parameters:
input-Terms to copy- Returns:
- copies of the specified {link Term}s
-
backtrack
Backtracks allTerms in the specified array.- Parameters:
terms-Terms to backtrack- See Also:
-
castToNumeric
-
toInt
- Parameters:
t- the term representing aNumeric- Returns:
- the
intvalue represented byt - Throws:
ProjogException- if the specifiedTermcannot be represented as anint.
-
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
-