public class AsynchMGArcImpl extends java.lang.Object implements AsynchMGArc
Modifier and Type | Method and Description |
---|---|
void |
accept(AsynchMGVisitor visitor)
For the visitor design pattern
|
void |
accept(DiGraphVisitor visitor)
As part of the Visitor pattern
|
void |
accept(MarkedGraphVisitor visitor)
For the visitor design pattern
|
void |
addArcListener(ArcListener l)
To add an
ArcListener on this object. |
void |
addAsynchMGArcListener(AsynchMGArcListener l) |
void |
addTokensInPlace(int nbTokens)
Add tokens to the marking
|
void |
consume()
To consume a token into the place of the arc
|
MGVertex |
getHead()
To get the head (destination) of the arc.
|
Port |
getHeadPort()
To get the port connecting this arc to head
|
int |
getMarking()
Gives the number of token in the arc.
|
java.lang.String |
getName()
To get the name of the object
|
MGVertex |
getTail()
To get the tail (source) of the arc.
|
Port |
getTailPort()
To get the port connecting this arc to Tail
|
int |
getTokenCount()
Gives the number of token in the arc.
|
boolean |
isActif()
Check whether the arc has a token available to fire the head vertex.
|
void |
produce()
To add a token into the place of the arc
|
void |
removeArcListener(ArcListener l)
To remove an
ArcListener on this object. |
void |
removeAsynchMGArcListener(AsynchMGArcListener l) |
void |
removeTokenFromPlace(int nbTokens)
Remove tokens to the marking
|
void |
setMarking(int marking)
Set the marking.
|
void |
setName(java.lang.String newName)
To set the name of the object
|
java.lang.String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addArcListener, getHeadPort, getTailPort, removeArcListener
getName, setName
public boolean isActif()
MGArc
public int getMarking()
AsynchMGArc
getMarking
in interface AsynchMGArc
public void setMarking(int marking)
AsynchMGArc
setMarking
in interface AsynchMGArc
public void addTokensInPlace(int nbTokens)
AsynchMGArc
addTokensInPlace
in interface AsynchMGArc
nbTokens
- the number of token to add.public void removeTokenFromPlace(int nbTokens)
AsynchMGArc
removeTokenFromPlace
in interface AsynchMGArc
nbTokens
- the number of token to remove.@API public MGVertex getTail()
Arc
@API public MGVertex getHead()
Arc
public void addAsynchMGArcListener(AsynchMGArcListener l)
addAsynchMGArcListener
in interface AsynchMGArc
public void removeAsynchMGArcListener(AsynchMGArcListener l)
removeAsynchMGArcListener
in interface AsynchMGArc
public void consume()
MGArc
public void produce()
MGArc
public java.lang.String toString()
toString
in class java.lang.Object
public void accept(DiGraphVisitor visitor)
Arc
public void accept(MarkedGraphVisitor visitor)
MGArc
public void accept(AsynchMGVisitor visitor)
AsynchMGArc
accept
in interface AsynchMGArc
visitor
- the visitorpublic int getTokenCount()
MGArc
getTokenCount
in interface MGArc
@API public java.lang.String getName()
NamedObject
getName
in interface NamedObject
@API public void setName(java.lang.String newName)
NamedObject
setName
in interface NamedObject
public void addArcListener(ArcListener l)
Arc
ArcListener
on this object.addArcListener
in interface Arc
l
- the listener to addpublic void removeArcListener(ArcListener l)
Arc
ArcListener
on this object.removeArcListener
in interface Arc
l
- the listener to removepublic Port getTailPort()
Arc
getTailPort
in interface Arc
public Port getHeadPort()
Arc
getHeadPort
in interface Arc