org.vizzini.ai.logic
Class ComplexSentenceNOT

java.lang.Object
  extended by org.vizzini.util.AbstractBean
      extended by org.vizzini.ai.logic.AbstractSentence
          extended by org.vizzini.ai.logic.AbstractComplexSentence
              extended by org.vizzini.ai.logic.ComplexSentenceNOT
All Implemented Interfaces:
Cloneable, IComplexSentence, ISentence

public class ComplexSentenceNOT
extends AbstractComplexSentence

Provides a complex sentence using the NOT connective. This is a degenerate case of a complex sentence as the left sentence is not used. 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.util.AbstractBean
IGNORE_PROPERTIES
 
Constructor Summary
protected ComplexSentenceNOT(ISentence right)
          Construct this object using the given parameter.
 
Method Summary
 boolean evaluate(Object contextItem)
          Return true if this expression, using the given object, evaluates to true.
 ConnectiveType getConnective()
          Return the connective.
protected  boolean isLeftRequired()
          Return true if the left sentence is required.
 
Methods inherited from class org.vizzini.ai.logic.AbstractComplexSentence
clone, getLeft, getRight, isChild, replaceChild, setLeft, setRight
 
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

ComplexSentenceNOT

protected ComplexSentenceNOT(ISentence right)
Construct this object using the given parameter.

Parameters:
right -
Since:
v0.2
Method Detail

evaluate

public boolean evaluate(Object contextItem)
                 throws LogicException
Return true if this expression, using the given object, evaluates to true.

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

getConnective

public ConnectiveType getConnective()
Description copied from interface: IComplexSentence
Return the connective.

Returns:
Return connectiveType.
Since:
v0.2

isLeftRequired

protected boolean isLeftRequired()
Return true if the left sentence is required.

Overrides:
isLeftRequired in class AbstractComplexSentence
Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02