vanted.petrinetelements
Class Transition

java.lang.Object
  extended by vanted.petrinetelements.NodePN
      extended by vanted.petrinetelements.Transition

public class Transition
extends NodePN

The Class Transition for transition handling.

Author:
Kevin Pucknat

Constructor Summary
Transition(org.graffiti.graph.Node node)
          Instantiates a new transition.
Transition(Transition transition)
          Instantiates a new reversible transition.
 
Method Summary
 void addGuard(Guard guard)
          Adds the guard of the transition.
 void addInArc(InArc arc)
          Adds the in arc of the transition.
 void addOutArc(OutArc arc)
          Adds the out arc of the transition.
 void addTransitionListener(TransitionListener listener)
          Adds the transition listener.
 Transition fire()
          Fire the transition.
 java.util.List<Guard> getGuards()
          Gets the guards of the transition.
 java.util.List<InArc> getInArcs()
          Gets the in arcs of the transition.
 java.util.List<OutArc> getOutArcs()
          Gets the out arcs of the transition.
 java.util.HashSet<Place> getPlaces()
          Gets the places.
 double getRate()
          Gets the rate.
 Transition getReversibleTransition()
          Gets the reversible transition.
 boolean isEnabled()
          Checks if the transition is enabled.
 boolean isRevTransition()
          Is the transition reversible.
 boolean isTimed()
          Checks if the transition is timed.
static boolean isTransition(org.graffiti.graph.Node nd)
          Checks if the node is a transition.
 void removeAllGuards()
          Removes the all guards of the transition.
 void removeGuard(Guard guard)
          Removes the guard of the transition.
 void setInArcs(java.util.List<InArc> inArcs)
          Sets the in arcs of the transition.
 void setOutArcs(java.util.List<OutArc> outArcs)
          Sets the out arcs of the transition.
 void setReversibleTransition(Transition transition)
          Sets a reversible transition.
 void setRevTransition(boolean isRev)
           
 
Methods inherited from class vanted.petrinetelements.NodePN
addDraw, addIdentity, addIgnoreNode, addNode, addReachability, getDraw, getID, getIdentity, getIgnoreNode, getName, getNode, getNodes, getReachability, removeDraw, removeIdentity, removeIgnoreNode, removeNode, removeReachability, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transition

public Transition(org.graffiti.graph.Node node)
Instantiates a new transition.

Parameters:
node - the node

Transition

public Transition(Transition transition)
Instantiates a new reversible transition.

Parameters:
node - the node
Method Detail

getReversibleTransition

public Transition getReversibleTransition()
Gets the reversible transition.


setReversibleTransition

public void setReversibleTransition(Transition transition)
Sets a reversible transition.

Parameters:
transition - the referenced transition

addOutArc

public void addOutArc(OutArc arc)
Adds the out arc of the transition.

Parameters:
arc - the arc

setInArcs

public void setInArcs(java.util.List<InArc> inArcs)
Sets the in arcs of the transition.

Parameters:
inArcs - the new in arcs

getInArcs

public java.util.List<InArc> getInArcs()
Gets the in arcs of the transition.

Returns:
the in arcs

addInArc

public void addInArc(InArc arc)
Adds the in arc of the transition.

Parameters:
arc - the arc

setOutArcs

public void setOutArcs(java.util.List<OutArc> outArcs)
Sets the out arcs of the transition.

Parameters:
outArcs - the new out arcs

getOutArcs

public java.util.List<OutArc> getOutArcs()
Gets the out arcs of the transition.

Returns:
the out arcs

isTransition

public static boolean isTransition(org.graffiti.graph.Node nd)
Checks if the node is a transition.

Parameters:
nd - the nd
Returns:
true, if is transition

addGuard

public void addGuard(Guard guard)
Adds the guard of the transition.

Parameters:
guard - the guard

removeGuard

public void removeGuard(Guard guard)
Removes the guard of the transition.

Parameters:
guard - the guard

removeAllGuards

public void removeAllGuards()
Removes the all guards of the transition.


getGuards

public java.util.List<Guard> getGuards()
Gets the guards of the transition.

Returns:
the guards

fire

public Transition fire()
Fire the transition.

Returns:
the transition

isEnabled

public boolean isEnabled()
Checks if the transition is enabled.

Returns:
true, if is enabled

addTransitionListener

public void addTransitionListener(TransitionListener listener)
Adds the transition listener.

Parameters:
listener - the listener

isTimed

public boolean isTimed()
Checks if the transition is timed.

Returns:
true, if is timed

getRate

public double getRate()
Gets the rate.

Returns:
the rate

getPlaces

public java.util.HashSet<Place> getPlaces()
Gets the places.

Returns:
the places

isRevTransition

public boolean isRevTransition()
Is the transition reversible.

Returns:
reversibles

setRevTransition

public void setRevTransition(boolean isRev)