Class PairLogicVarBundle

java.lang.Object
  extended by PairLogicVarBundle
All Implemented Interfaces:
ILogicVarBundle

public class PairLogicVarBundle
extends java.lang.Object
implements ILogicVarBundle

This class is a little weird. The intent is that one casts an ILogicVarBundle to one of these, and uses the get and set methods on the first and second members. Directly accessing "get" and "set" for this class will fail for everything except for agentId methods.


Constructor Summary
PairLogicVarBundle()
           
PairLogicVarBundle(ILogicVarBundle varsFirst, ILogicVarBundle varsSecond)
           
 
Method Summary
 ILogicVarBundle accessFirst()
           
 ILogicVarBundle accessSecond()
           
 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 setFirst(ILogicVarBundle varsFirst)
           
 void setId(int nId)
          Sets unique Id of this agent
 void setSecond(ILogicVarBundle varsSecond)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairLogicVarBundle

public PairLogicVarBundle()

PairLogicVarBundle

public PairLogicVarBundle(ILogicVarBundle varsFirst,
                          ILogicVarBundle varsSecond)
Method Detail

setFirst

public void setFirst(ILogicVarBundle varsFirst)

setSecond

public void setSecond(ILogicVarBundle varsSecond)

accessFirst

public ILogicVarBundle accessFirst()

accessSecond

public ILogicVarBundle accessSecond()

getBoolVar

public java.lang.Boolean getBoolVar(java.lang.Object refObject)
Description copied from interface: ILogicVarBundle
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

getId

public int getId()
Description copied from interface: ILogicVarBundle
Gets unique Id of this agent

Specified by:
getId in interface ILogicVarBundle

getIntVar

public java.lang.Integer getIntVar(java.lang.Object refObject)
Description copied from interface: ILogicVarBundle
gets an Integer (wrapping an int) referred to by an object. returns null if refObject is of invalid type 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.

insertBoolVar

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

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

insertIntVar

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

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

makeCopy

public ILogicVarBundle makeCopy()
Description copied from interface: ILogicVarBundle
makes a copy and returns it

Specified by:
makeCopy in interface ILogicVarBundle

setId

public void setId(int nId)
Description copied from interface: ILogicVarBundle
Sets unique Id of this agent

Specified by:
setId in interface ILogicVarBundle