Class LogicVarIntLookup

java.lang.Object
  extended by LogicVarIntLookup
All Implemented Interfaces:
ILogicVarBundle
Direct Known Subclasses:
TreeConstraintState

public class LogicVarIntLookup
extends java.lang.Object
implements ILogicVarBundle

Implementation of ILogicVarBundle that just wraps an int map.

ILogicVarBundle is the interface for the discrete component of robotic agent state. This is the component of DiscreteAgentState that gets fed back into the agent for the next round of

Since:
1.0

Constructor Summary
LogicVarIntLookup()
           
LogicVarIntLookup(LogicVarIntLookup src)
           
 
Method Summary
protected  void copyFrom(LogicVarIntLookup src)
          just a little thing to help out derived classes.
 java.lang.Boolean getBoolVar(java.lang.Object refObject)
          gets a Boolean (wrapping a boolean) referred to by an object.
 int getId()
          Gets unique Id of this agent
 java.lang.Integer getIntVar(java.lang.Object refObject)
          gets an Integer (wrapping an int) referred to by an object.
 boolean insertBoolVar(java.lang.Object refObject, boolean bValue)
          inserts an boolean value (see getBoolVar).
 boolean insertIntVar(java.lang.Object refObject, int nValue)
          inserts an integer value (see getIntvar).
 ILogicVarBundle makeCopy()
          makes a copy and returns it
 void removeVar(java.lang.Object refObject)
          Removes any values indexed by refObject
 void setId(int nId)
          Sets unique Id of this agent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicVarIntLookup

public LogicVarIntLookup()

LogicVarIntLookup

public LogicVarIntLookup(LogicVarIntLookup src)
Method Detail

copyFrom

protected void copyFrom(LogicVarIntLookup src)
just a little thing to help out derived classes.

Parameters:
src -

makeCopy

public ILogicVarBundle makeCopy()
makes a copy and returns it

Specified by:
makeCopy in interface ILogicVarBundle

getId

public int getId()
Gets unique Id of this agent

Specified by:
getId in interface ILogicVarBundle

setId

public void setId(int nId)
Sets unique Id of this agent

Specified by:
setId in interface ILogicVarBundle

getIntVar

public java.lang.Integer getIntVar(java.lang.Object refObject)
gets an Integer (wrapping an int) referred to by an object. returns null if refObject is of invalid type (in this case the correct type is Integer) or indexes an invalid logic var. Note: The original specification only allowed boolean variables in this place. Obviously some applications may want to use collections of boolean variables to represent integers over a finite fixed range, or rationals with finite fixed precision over a finite fixed range. This function is merely provided as a shortcut towards this end.

Specified by:
getIntVar in interface ILogicVarBundle

removeVar

public void removeVar(java.lang.Object refObject)
Removes any values indexed by refObject

Specified by:
removeVar in interface ILogicVarBundle
Parameters:
refObject - remove values associated with this.

insertIntVar

public boolean insertIntVar(java.lang.Object refObject,
                            int nValue)
inserts an integer value (see getIntvar). Returns fals if this insert was not permitted

Specified by:
insertIntVar in interface ILogicVarBundle
See Also:
getIntVar(java.lang.Object)

getBoolVar

public java.lang.Boolean getBoolVar(java.lang.Object refObject)
gets a Boolean (wrapping a boolean) referred to by an object. returns null if refObject is of invalid type or indexes an invalid logic var.

Specified by:
getBoolVar in interface ILogicVarBundle

insertBoolVar

public boolean insertBoolVar(java.lang.Object refObject,
                             boolean bValue)
inserts an boolean value (see getBoolVar). Returns fals if this insert was not permitted

Specified by:
insertBoolVar in interface ILogicVarBundle
See Also:
getBoolVar(java.lang.Object)