org.vizzini.ai.logic
Class AbstractBinaryAtomicSentence

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
All Implemented Interfaces:
Cloneable, IAtomicSentence, IBinaryAtomicSentence, ISentence
Direct Known Subclasses:
AtomicSentenceEQ, AtomicSentenceGT, AtomicSentenceLT

public abstract class AbstractBinaryAtomicSentence
extends AbstractAtomicSentence
implements IBinaryAtomicSentence

Provides base functionality for binary atomic sentences in the logic system. A binary atomic sentence consists of a left argument, an operator, and a right argument. The sentence evaluates to true or false in the context of a given item.

Since:
v0.2
Version:
v0.2
Author:
Jeffrey M. Thompson

Field Summary
protected static int COMPARISON_UNKNOWN
          Constant indicating the comparison was impossible to determine.
 
Fields inherited from class org.vizzini.util.AbstractBean
IGNORE_PROPERTIES
 
Constructor Summary
protected AbstractBinaryAtomicSentence(IArgument left, IArgument right, boolean useForwardLogic)
          Construct this object.
 
Method Summary
 Object clone()
          Return a clone of this instance.
protected static int compareTo(Object left, Object right)
          Return an integer which indicates the comparison relationship. left < right : -1, left == right : 0, left > right : 1.
 IArgument getLeft()
          Return the left side argument.
 IArgument getRight()
          Return the right side argument.
 boolean isUseForwardLogic()
           
protected static Object promoteString(Class newClass, String object)
          Promote the given string to the given class, if possible.
protected static Boolean promoteStringToBoolean(String object)
          Promote the given string to Boolean, if possible.
protected  void setLeft(IArgument left)
           
protected  void setRight(IArgument right)
           
protected  void setUseForwardLogic(boolean useForwardLogic)
           
 
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.IBinaryAtomicSentence
getOperator
 
Methods inherited from interface org.vizzini.ai.logic.ISentence
evaluate, getDescription, setDescription
 

Field Detail

COMPARISON_UNKNOWN

protected static final int COMPARISON_UNKNOWN
Constant indicating the comparison was impossible to determine.

See Also:
Constant Field Values
Constructor Detail

AbstractBinaryAtomicSentence

protected AbstractBinaryAtomicSentence(IArgument left,
                                       IArgument right,
                                       boolean useForwardLogic)
Construct this object.

Since:
v0.2
Method Detail

clone

public Object clone()
Return a clone of this instance.

Specified by:
clone in interface ISentence
Overrides:
clone in class AbstractSentence
Since:
v0.2

getLeft

public IArgument getLeft()
Return the left side argument.

Specified by:
getLeft in interface IBinaryAtomicSentence
Since:
v0.2

getRight

public IArgument getRight()
Return the right side argument.

Specified by:
getRight in interface IBinaryAtomicSentence
Since:
v0.2

isUseForwardLogic

public boolean isUseForwardLogic()
Returns:
Return useForwardLogic.
Since:
v0.2

compareTo

protected static int compareTo(Object left,
                               Object right)
Return an integer which indicates the comparison relationship. left < right : -1, left == right : 0, left > right : 1.

Since:
v0.2

promoteString

protected static Object promoteString(Class newClass,
                                      String object)
Promote the given string to the given class, if possible.

Since:
v0.2

promoteStringToBoolean

protected static Boolean promoteStringToBoolean(String object)
Promote the given string to Boolean, if possible.

Since:
v0.2

setLeft

protected void setLeft(IArgument left)
Parameters:
left - The left to set.
Since:
v0.2

setRight

protected void setRight(IArgument right)
Parameters:
right - The right to set.
Since:
v0.2

setUseForwardLogic

protected void setUseForwardLogic(boolean useForwardLogic)
Parameters:
useForwardLogic - The useForwardLogic to set.
Since:
v0.2


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