org.vizzini.ai.logic
Class PropertyArgument

java.lang.Object
  extended by org.vizzini.util.AbstractBean
      extended by org.vizzini.ai.logic.AbstractArgument
          extended by org.vizzini.ai.logic.PropertyArgument
All Implemented Interfaces:
Cloneable, IArgument

public class PropertyArgument
extends AbstractArgument

Provides a property argument for use in sentences in the logic system. This argument obtains its value from a property of the context item. Instances of this class are obtained from ArgumentFactory.create().

Since:
v0.2
Version:
v0.2
Author:
Jeffrey M. Thompson
See Also:
ArgumentFactory.create(java.lang.Object)

Field Summary
 
Fields inherited from class org.vizzini.util.AbstractBean
IGNORE_PROPERTIES
 
Constructor Summary
protected PropertyArgument(String propertyName)
          Construct this object.
 
Method Summary
 ArgumentType getArgumentType()
          Return the arg type.
 String getPropertyName()
           
 Object getValue(Object contextItem)
          Return the value of this argument using the given context item.
protected  void setPropertyName(String propertyName)
           
 
Methods inherited from class org.vizzini.ai.logic.AbstractArgument
clone
 
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
 

Constructor Detail

PropertyArgument

protected PropertyArgument(String propertyName)
Construct this object.

Parameters:
propertyName - Property name.
Since:
v0.2
Method Detail

getArgumentType

public ArgumentType getArgumentType()
Return the arg type.

Since:
v0.2

getPropertyName

public String getPropertyName()
Returns:
Return propertyName.
Since:
v0.2

getValue

public Object getValue(Object contextItem)
                throws LogicException
Return the value of this argument using the given context item. As a special case, the property name "this" simply returns the given context item.

Parameters:
contextItem - Context item which is the source of the property value.
Throws:
LogicException
Since:
v0.2

setPropertyName

protected void setPropertyName(String propertyName)
Parameters:
propertyName - The propertyName to set.
Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02