org.vizzini.ai.logic
Class AtomicSentenceEQ

java.lang.Object
  extended by org.vizzini.util.AbstractBean
      extended by org.vizzini.ai.logic.AbstractSentence
          extended by org.vizzini.ai.logic.AbstractAtomicSentence
              extended by org.vizzini.ai.logic.AbstractBinaryAtomicSentence
                  extended by org.vizzini.ai.logic.AtomicSentenceEQ
All Implemented Interfaces:
Cloneable, IAtomicSentence, IBinaryAtomicSentence, ISentence

public class AtomicSentenceEQ
extends AbstractBinaryAtomicSentence

Provides a binary atomic sentence using equals. The flag useForwardLogic allows this class to also be used as not-equals. Instances of this class are obtained from SentenceFactory.create().

Since:
v0.2
Version:
v0.2
Author:
Jeffrey M. Thompson
See Also:
SentenceFactory.create(org.vizzini.ai.logic.IArgument, java.lang.String, org.vizzini.ai.logic.IArgument)

Field Summary
 
Fields inherited from class org.vizzini.ai.logic.AbstractBinaryAtomicSentence
COMPARISON_UNKNOWN
 
Fields inherited from class org.vizzini.util.AbstractBean
IGNORE_PROPERTIES
 
Constructor Summary
protected AtomicSentenceEQ(IArgument left, IArgument right, boolean useForwardLogic)
          Construct this object with the given parameters.
 
Method Summary
 boolean evaluate(Object contextItem)
          Return true if this sentence, in the context of the given object, evaluates to true.
 OperatorType getOperator()
          Return the operator.
 
Methods inherited from class org.vizzini.ai.logic.AbstractBinaryAtomicSentence
clone, compareTo, getLeft, getRight, isUseForwardLogic, promoteString, promoteStringToBoolean, setLeft, setRight, setUseForwardLogic
 
Methods inherited from class org.vizzini.ai.logic.AbstractSentence
getDescription, setDescription
 
Methods inherited from class org.vizzini.util.AbstractBean
appendArray, appendCollection, appendList, appendMap, compareBooleans, compareObjects, equals, getIgnoreProperties, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.ai.logic.ISentence
getDescription, setDescription
 

Constructor Detail

AtomicSentenceEQ

protected AtomicSentenceEQ(IArgument left,
                           IArgument right,
                           boolean useForwardLogic)
Construct this object with the given parameters.

Parameters:
left - Left argument.
right - Right argument.
useForwardLogic - Flag indicating whether to use forward logic.
Since:
v0.2
Method Detail

evaluate

public boolean evaluate(Object contextItem)
                 throws LogicException
Return true if this sentence, in the context of the given object, evaluates to true.

Parameters:
contextItem - Item in whose context to evaluate this sentence.
Throws:
LogicException
Since:
v0.2

getOperator

public OperatorType getOperator()
Return the operator.

Since:
v0.2


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02