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

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.DeleteCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IDeleteCtx, IRuntimeConstants, java.io.Serializable
Direct Known Subclasses:
VMDeleteCtx

public class DeleteCtx
extends BrahmsObjectCtx
implements IDeleteCtx

The DeleteCtx is the context for an executed delete operation. It defines the delete operation that was executed, what frame executed the operation and defines what element(s) was/were marked for deletion.

Version:
$Revision: 1.2 $ $Date: 2009/11/23 19:12:22 $ $Author: rnado $
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
DeleteCtx(Delete delete)
          Constructor, creates a new delete context for the specified delete operation.
 
Method Summary
 void addDeletedElement(java.lang.Object elm)
          Adds the specified element (agent, object, conceptual object, or monitored Java object) as an element marked for deletion.
 java.util.List<java.lang.Object> getDeletedElements()
          Returns a list of all the elements deleted by this delete operation.
 IFrameCtx getParent()
          Returns the parent frame context in which this delete operation was executed.
 IVariableCtx getUsedVariable()
          Returns the variable used by this delete operation.
 boolean hasDeletedElements()
          Indicates whether the context has any deleted elements in its list.
 void removeDeletedElement(java.lang.Object elm)
          Removes the specified element (agent, object, conceptual object, or monitored Java object) as an element marked for deletion.
 void setParent(IFrameCtx parent)
          Sets the parent frame context in which this delete operation was executed.
 void setUsedVariable(IVariableCtx var)
          Sets the specified variable as a variable used by this delete operation.
 java.lang.String toString()
          Returns the string representation of the delete context, returning the id and the delete itself.
 
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, 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

DeleteCtx

public DeleteCtx(Delete delete)
Constructor, creates a new delete context for the specified delete operation.

Parameters:
delete - the exeuted delete operation for which this context is the context
Method Detail

setParent

public void setParent(IFrameCtx parent)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the parent frame context in which this delete operation was executed.

Specified by:
setParent in interface IDeleteCtx
Parameters:
parent - the IFrameCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null parent is specified

getParent

public IFrameCtx getParent()
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the parent frame context in which this delete operation was executed.

Specified by:
getParent in interface IDeleteCtx
Returns:
IFrameCtx the parent frame
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no parent is specified

addDeletedElement

public void addDeletedElement(java.lang.Object elm)
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified element (agent, object, conceptual object, or monitored Java object) as an element marked for deletion.

Specified by:
addDeletedElement in interface IDeleteCtx
Parameters:
elm - the element to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if elm is null

removeDeletedElement

public void removeDeletedElement(java.lang.Object elm)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified element (agent, object, conceptual object, or monitored Java object) as an element marked for deletion.

Specified by:
removeDeletedElement in interface IDeleteCtx
Parameters:
elm - the element to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if elm is null, no elements are present, or the element is not found

getDeletedElements

public java.util.List<java.lang.Object> getDeletedElements()
                                                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the elements deleted by this delete operation.

Specified by:
getDeletedElements in interface IDeleteCtx
Returns:
List the list of deleted elements
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no elements

hasDeletedElements

public boolean hasDeletedElements()
Indicates whether the context has any deleted elements in its list.

Specified by:
hasDeletedElements in interface IDeleteCtx
Returns:
boolean true if the context has deleted elements, false otherwise

setUsedVariable

public void setUsedVariable(IVariableCtx var)
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the specified variable as a variable used by this delete operation.

Specified by:
setUsedVariable in interface IDeleteCtx
Parameters:
var - the variable (IVariableCtx)
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if var is null

getUsedVariable

public IVariableCtx getUsedVariable()
                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the variable used by this delete operation.

Specified by:
getUsedVariable in interface IDeleteCtx
Returns:
IVariableCtx the variable
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no variable was used

toString

public java.lang.String toString()
Returns the string representation of the delete context, returning the id and the delete itself.

Overrides:
toString in class java.lang.Object
Returns:
String the string representation of the delete context


Copyright © 1997-2012 All Rights Reserved.