experiment.entity
Class Entity

java.lang.Object
  extended by experiment.entity.Entity
Direct Known Subclasses:
Link, Node

public class Entity
extends java.lang.Object

Created by IntelliJ IDEA. User: andy Date: Mar 11, 2010


Field Summary
protected  java.util.HashMap<java.lang.String,Capability> capabilityMap
           
protected  boolean enabled
           
 Entity3d entity3d
           
protected  boolean isNode
           
 java.lang.Object lock
           
protected  ExperimentState state
           
 
Constructor Summary
Entity(ExperimentState state)
          Default Constructor
 
Method Summary
 Capability getCapability(java.lang.String name)
          Return a capability of the entity.
 java.util.Collection<Capability> getCapabilitySet()
           
 Entity3d getEntity3d()
           
 ExperimentState getState()
           
 boolean isEnabled()
          Find out if the entity is enabled
 boolean isNode()
          Used tp distinguish between Node and Links.
 void setCapability(Capability c)
          Update a capability if it's already known else create it.
 void setCapability(java.lang.String name, java.lang.String value)
          Update a capability if it's already known else create it.
 void setEntity3d(Entity3d entity3d)
          Associates an Entity object with its visual representation.
 void setMonitored(boolean bool)
          A monitored entity is being displayed by the FrontEnd gui.
 void setState(ExperimentState state)
          Set the entity's state
 void setStatus(boolean status)
          Set the entity's status.
 void updated()
          Signals a change in this object since it has last been monitored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capabilityMap

protected java.util.HashMap<java.lang.String,Capability> capabilityMap

enabled

protected volatile boolean enabled

entity3d

public transient Entity3d entity3d

isNode

protected boolean isNode

lock

public final java.lang.Object lock

state

protected ExperimentState state
Constructor Detail

Entity

public Entity(ExperimentState state)
Default Constructor

Parameters:
state - an experiment state.
Method Detail

getCapability

public Capability getCapability(java.lang.String name)
Return a capability of the entity.

Parameters:
name - the name of the capability
Returns:
the capability if it exists else null

getCapabilitySet

public java.util.Collection<Capability> getCapabilitySet()
Returns:
a Collection of all the entity's Capabilities.

getEntity3d

public Entity3d getEntity3d()
Returns:
the Entity3d object that is the visual 3d representation of this object.

getState

public ExperimentState getState()
Returns:
the object's state

isEnabled

public boolean isEnabled()
Find out if the entity is enabled

Returns:
true if the entity is enabled

isNode

public boolean isNode()
Used tp distinguish between Node and Links.

Returns:
true if the instance is a Node.

setCapability

public void setCapability(Capability c)
Update a capability if it's already known else create it. It is called during experiment initilization i.e. during setup parsing.

Parameters:
c - the new capability

setCapability

public void setCapability(java.lang.String name,
                          java.lang.String value)
Update a capability if it's already known else create it. It is usually called during experiment visualization i.e. during trace parsing.

Parameters:
name - the name of the capability that has to be updated.
value - the new value.

setEntity3d

public void setEntity3d(Entity3d entity3d)
Associates an Entity object with its visual representation.

Parameters:
entity3d - contains the 3d representation of this object.

setMonitored

public void setMonitored(boolean bool)
A monitored entity is being displayed by the FrontEnd gui.

Parameters:
bool - true for monitored, false for not.

setState

public void setState(ExperimentState state)
Set the entity's state

Parameters:
state - the entity's state

setStatus

public void setStatus(boolean status)
Set the entity's status.

Parameters:
status - true to enable it and false to disable it

updated

public void updated()
Signals a change in this object since it has last been monitored. Is called in the process of notifying the FrontEnd that the monitored Entity was updated.