org.deri.iris.builtins
Class EqualBuiltin

java.lang.Object
  extended by org.deri.iris.builtins.AbstractBuiltin
      extended by org.deri.iris.builtins.ArithmeticBuiltin
          extended by org.deri.iris.builtins.EqualBuiltin
All Implemented Interfaces:
Comparable<IAtom>, IAtom, IBuiltinAtom
Direct Known Subclasses:
BooleanEqualBuiltin, DateEqualBuiltin, DateTimeEqualBuiltin, DurationEqualBuiltin, NumericEqualBuiltin, TimeEqualBuiltin, XMLLiteralEqualBuiltin

public class EqualBuiltin
extends ArithmeticBuiltin

Built-in to either: a) compare two terms for equality, OR b) assign a constant expression to a variable


Field Summary
 
Fields inherited from class org.deri.iris.builtins.AbstractBuiltin
EMPTY_TERM
 
Constructor Summary
protected EqualBuiltin(IPredicate predicate, ITerm... terms)
          Construct a new EqualBuiltin for the specific predicate and terms.
  EqualBuiltin(ITerm... t)
          Constructor.
 
Method Summary
protected  ITerm computeMissingTerm(int missingTermIndex, ITerm[] terms)
          Compute the missing term when the other two are known.
 
Methods inherited from class org.deri.iris.builtins.ArithmeticBuiltin
evaluateTerms, maxUnknownVariables, testForEquality
 
Methods inherited from class org.deri.iris.builtins.AbstractBuiltin
compareTo, equals, evaluate, getPredicate, getTuple, hashCode, isBuiltin, isGround, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EqualBuiltin

protected EqualBuiltin(IPredicate predicate,
                       ITerm... terms)
Construct a new EqualBuiltin for the specific predicate and terms.

Parameters:
predicate - The predicate of the built-in.
terms - The terms.
Throws:
NullPointerException - If the predicate or one of the terms is null.
IllegalArgumentException - If the length of the terms and the arity of the predicate do not match.

EqualBuiltin

public EqualBuiltin(ITerm... t)
Constructor.

Parameters:
terms - The terms, must be two of these
Throws:
NullPointerException - If the predicate or one of the terms is null.
IllegalArgumentException - If the length of the terms and the arity of the predicate do not match.
Method Detail

computeMissingTerm

protected ITerm computeMissingTerm(int missingTermIndex,
                                   ITerm[] terms)
Description copied from class: ArithmeticBuiltin
Compute the missing term when the other two are known.

Specified by:
computeMissingTerm in class ArithmeticBuiltin
terms - The collection of all terms.
Returns:
The computed value.