object
Class PublicVariable

java.lang.Object
  extended by object.PublicVariable
Direct Known Subclasses:
CumulativeVariable, DummyVariable, ExclusiveVariable, ViewableVariable

public abstract class PublicVariable
extends java.lang.Object

This is the root class for all share-able variables in an HLA_RePast model. A PublicObject instance may be made up of a mix of PublicVariables and standard Java variables (eg. an agent's position may be represented as ViewablePoint whilst its rule-base (or whatever cognitive model) is represented as a standard Java Hashtable. This would result in changes to position being reflected to RemoteObject proxies of the agent but changes in the rule-base remaining purely within the local JVM. An extensive collection of

Author:
Rob Minson

Nested Class Summary
static class PublicVariable.OwnershipState
           
 
Field Summary
protected  boolean hasValue
           
protected  int myHandle
           
protected  ObjectLookup obLook
           
protected  int ownersHandle
           
protected  PublicVariable.OwnershipState ownership
           
 
Constructor Summary
PublicVariable()
           
 
Method Summary
 void addVariableListener(VariableListener listener)
           
protected  boolean checkOwnership()
           
 boolean isOwned()
           
 void removeVariableListener(VariableListener listener)
           
protected  void requestOwnership()
           
protected  boolean waitForOwnershipResolution()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ownership

protected PublicVariable.OwnershipState ownership

obLook

protected ObjectLookup obLook

myHandle

protected int myHandle

ownersHandle

protected int ownersHandle

hasValue

protected boolean hasValue
Constructor Detail

PublicVariable

public PublicVariable()
Method Detail

isOwned

public boolean isOwned()

requestOwnership

protected void requestOwnership()
                         throws hla.rti13.java1.RTIexception
Throws:
hla.rti13.java1.RTIexception

checkOwnership

protected boolean checkOwnership()
                          throws java.lang.IllegalStateException,
                                 hla.rti13.java1.RTIexception
Throws:
java.lang.IllegalStateException
hla.rti13.java1.RTIexception

waitForOwnershipResolution

protected boolean waitForOwnershipResolution()

addVariableListener

public void addVariableListener(VariableListener listener)

removeVariableListener

public void removeVariableListener(VariableListener listener)