gov.nasa.arc.brahms.common.rt
Class TransferDefinitionCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ConditionCtx
          extended by gov.nasa.arc.brahms.common.rt.TransferDefinitionCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IConditionCtx, IRuntimeConstants, ITransferDefinitionCtx, java.io.Serializable
Direct Known Subclasses:
VMTransferDefinitionCtx

public class TransferDefinitionCtx
extends ConditionCtx
implements ITransferDefinitionCtx

The TransferDefinitionCtx is the context for a transfer definition defining in what communication or broadcast activity the transfer took place, the direction of the transfer, the communicated beliefs, the beliefs created by the transfer definition, the parameters used by the transfer definition and the variables bound by this transfer definition.

Version:
$Revision: 1.1 $ $Date: 2007/10/10 14:12:55 $ $Author: rvhoof $
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, DETECTABLE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE
 
Constructor Summary
TransferDefinitionCtx(TransferDefinition transferDefinition)
          Constructor, creates a new transfer definition context for the specified transfer definition
 
Method Summary
 void addBoundVariable(VariableCtx var)
          Adds the specified variable as a variable bound by this transfer definition.
 void addCreatedBelief(IBeliefCtx belief)
          Adds the specified belief as a belief created by this transfer definition.
 void addTransferredBelief(IBeliefCtx belief)
          Adds the specified belief as a belief transferred by this transfer definition.
 void addTransferredCommunicativeAct(IObjectInstanceCtx ca)
          Adds the specified CommunicativeAct as a CommunicativeAct transferred by this transfer definition.
 void addUsedParameter(ParameterCtx p)
          Adds the specified parameter as a parameter used by this transfer definition.
 java.util.Enumeration getBoundVariables()
          Returns a list of all the variables bound by this transfer definition.
 java.util.Enumeration getCreatedBeliefs()
          Returns a list of all the beliefs created by this transfer definition.
 int getDirection()
          Returns the direction of the communication for this transfer definition
 IBroadcastActivityCtx getParent()
          Returns the parent communicate or broadcast activity context in which this transfer definition is used.
 java.util.Enumeration getTransferredBeliefs()
          Returns a list of all the beliefs transferred throught this transfer definition.
 java.util.Enumeration getTransferredCommunicativeActs()
          Returns a list of all the CommunicativeActs transferred through this transfer definition.
 java.util.Enumeration getUsedParameters()
          Returns a list of all the parameters used by this transfer definition.
 boolean isTransferredBeliefs()
          Indicates whether the transfer definition context was used to transfer beliefs instead of CommunicativeActs.
 boolean isTransferredCommunicativeActs()
          Indicates whether the transfer definition context was used to transfer CommunicativeActs instead of beliefs.
 void removeBoundVariable(VariableCtx var)
          Removes the specified variable as a variable bound by this transfer definition.
 void removeCreatedBelief(IBeliefCtx belief)
          Removes the specified belief as a belief created by this transfer definition.
 void removeTransferredBelief(IBeliefCtx belief)
          Removes the specified belief as a belief transferred by this transfer definition.
 void removeUsedParameter(ParameterCtx p)
          Removes the specified parameter as a parameter used by this transfer definition.
 void setDirection(int direction)
          Sets the direction of the communication for this transfer definition
 void setParent(IBroadcastActivityCtx parent)
          Sets the parent communicate or broadcast activity context in which this transfer definition is used.
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setContextFor, setEndTime, setID, setStartTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

TransferDefinitionCtx

public TransferDefinitionCtx(TransferDefinition transferDefinition)
Constructor, creates a new transfer definition context for the specified transfer definition

Parameters:
transferDefinition - the TransferDefinition for which this is a context
Method Detail

setParent

public void setParent(IBroadcastActivityCtx parent)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the parent communicate or broadcast activity context in which this transfer definition is used.

Specified by:
setParent in interface ITransferDefinitionCtx
Parameters:
parent - the CommunicateActivityCtx in which the transfer definition is used
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null parent is specified

getParent

public IBroadcastActivityCtx getParent()
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the parent communicate or broadcast activity context in which this transfer definition is used.

Specified by:
getParent in interface ITransferDefinitionCtx
Returns:
IBroadcastActivityCtx the parent communicate or broadcast activity context in which the transfer definition is used
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no parent is specified

setDirection

public void setDirection(int direction)
                  throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the direction of the communication for this transfer definition

Specified by:
setDirection in interface ITransferDefinitionCtx
Parameters:
direction - the direction of the transfer
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid direction is specified
See Also:
IRuntimeConstants.FROM, IRuntimeConstants.TO

getDirection

public int getDirection()
                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the direction of the communication for this transfer definition

Specified by:
getDirection in interface ITransferDefinitionCtx
Returns:
int the direction
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no direction is specified
See Also:
IRuntimeConstants.FROM, IRuntimeConstants.TO

isTransferredCommunicativeActs

public boolean isTransferredCommunicativeActs()
Indicates whether the transfer definition context was used to transfer CommunicativeActs instead of beliefs.

Specified by:
isTransferredCommunicativeActs in interface ITransferDefinitionCtx
Returns:
boolean true if used to transfer CommunicativeActs, false if beliefs

addTransferredCommunicativeAct

public void addTransferredCommunicativeAct(IObjectInstanceCtx ca)
                                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified CommunicativeAct as a CommunicativeAct transferred by this transfer definition.

Specified by:
addTransferredCommunicativeAct in interface ITransferDefinitionCtx
Parameters:
ca - the CommunicativeAct (IObjectInstanceCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if ca is null

getTransferredCommunicativeActs

public java.util.Enumeration getTransferredCommunicativeActs()
                                                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the CommunicativeActs transferred through this transfer definition.

Specified by:
getTransferredCommunicativeActs in interface ITransferDefinitionCtx
Returns:
Enumeration an enumeration of IObjectInstanceCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no transferred CommunicativeActs

isTransferredBeliefs

public boolean isTransferredBeliefs()
Indicates whether the transfer definition context was used to transfer beliefs instead of CommunicativeActs.

Specified by:
isTransferredBeliefs in interface ITransferDefinitionCtx
Returns:
boolean true if used to transfer beliefs, false if CommunicativeActs

addTransferredBelief

public void addTransferredBelief(IBeliefCtx belief)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified belief as a belief transferred by this transfer definition.

Specified by:
addTransferredBelief in interface ITransferDefinitionCtx
Parameters:
belief - the belief (IBeliefCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if belief is null

removeTransferredBelief

public void removeTransferredBelief(IBeliefCtx belief)
                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified belief as a belief transferred by this transfer definition.

Specified by:
removeTransferredBelief in interface ITransferDefinitionCtx
Parameters:
belief - the belief (IBeliefCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if belief is null, no transferred beliefs are present, or the belief is not found

getTransferredBeliefs

public java.util.Enumeration getTransferredBeliefs()
                                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the beliefs transferred throught this transfer definition.

Specified by:
getTransferredBeliefs in interface ITransferDefinitionCtx
Returns:
Enumeration an enumeration of IBeliefCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no transferred beliefs

addCreatedBelief

public void addCreatedBelief(IBeliefCtx belief)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified belief as a belief created by this transfer definition.

Specified by:
addCreatedBelief in interface ITransferDefinitionCtx
Parameters:
belief - the belief (IBeliefCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if belief is null

removeCreatedBelief

public void removeCreatedBelief(IBeliefCtx belief)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified belief as a belief created by this transfer definition.

Specified by:
removeCreatedBelief in interface ITransferDefinitionCtx
Parameters:
belief - the belief to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if belief is null, no beliefs are present, or the belief is not found

getCreatedBeliefs

public java.util.Enumeration getCreatedBeliefs()
                                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the beliefs created by this transfer definition.

Specified by:
getCreatedBeliefs in interface ITransferDefinitionCtx
Returns:
Enumeration an enumeration of IBeliefCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no beliefs

addUsedParameter

public void addUsedParameter(ParameterCtx p)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified parameter as a parameter used by this transfer definition.

Specified by:
addUsedParameter in interface ITransferDefinitionCtx
Parameters:
p - the parameter (ParameterCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if parameter is null

removeUsedParameter

public void removeUsedParameter(ParameterCtx p)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified parameter as a parameter used by this transfer definition.

Specified by:
removeUsedParameter in interface ITransferDefinitionCtx
Parameters:
p - the parameter (ParameterCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if parameter is null, no parameters are present, or the parameter is not found

getUsedParameters

public java.util.Enumeration getUsedParameters()
                                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the parameters used by this transfer definition.

Specified by:
getUsedParameters in interface ITransferDefinitionCtx
Returns:
Enumeration an enumeration of ParameterCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no parameters

addBoundVariable

public void addBoundVariable(VariableCtx var)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified variable as a variable bound by this transfer definition.

Specified by:
addBoundVariable in interface ITransferDefinitionCtx
Parameters:
var - the variable (VariableCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if var is null

removeBoundVariable

public void removeBoundVariable(VariableCtx var)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified variable as a variable bound by this transfer definition.

Specified by:
removeBoundVariable in interface ITransferDefinitionCtx
Parameters:
var - the variable (VariableCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if variable is null, no variables are present, or the variable is not found

getBoundVariables

public java.util.Enumeration getBoundVariables()
                                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the variables bound by this transfer definition.

Specified by:
getBoundVariables in interface ITransferDefinitionCtx
Returns:
Enumeration an enumeration of VariableCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no variables


Copyright © 1997-2012 All Rights Reserved.