Package com.uppaal.model.core2
Class Edge
- java.lang.Object
-
- com.uppaal.model.core2.Element
-
- com.uppaal.model.core2.Node
-
- com.uppaal.model.core2.Edge
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class Edge extends Node
Edge models discrete transitions between locations.An
Edgemay haveNails as children in theNode.Probabilistic edges are modeled by a pair of
Edges connected via BranchPoint.Edges may have labels modeled by properties:
"select", "guard", "synchronisation", "assignment", "probability", "controllable", "comments", "color".
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractLocationsourceprotected AbstractLocationtarget-
Fields inherited from class com.uppaal.model.core2.Element
listeners, properties, prototype
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)Accept a visitor.NailcreateNail()Creates a nail based on prototype, the nail has to be inserted into an edge.NailgetNails()Returns the first nail (if any).java.lang.StringgetName()Constructs a human-friendly name of this edge.ElementgetPrototypeFromParent(Element parent)Returns the #edge property value of the parent argument.AbstractLocationgetSource()Returns the source location (the beginning of the edge).AbstractLocationgetTarget()Returns the target location (the end of the edge).java.lang.String[]getXMLLabelKinds()Returns possible XML label kinds this element supports.voidsetSource(AbstractLocation source)Sets the origin of this edge.voidsetTarget(AbstractLocation target)Sets the destination of this edge.-
Methods inherited from class com.uppaal.model.core2.Node
clone, getFirst, getLast, getNext, getPrevious, getXPathTag, insert, move, remove, setPrototype
-
Methods inherited from class com.uppaal.model.core2.Element
acceptSafe, addListener, getColor, getCommandManager, getDocument, getLocalProperty, getParent, getProperties, getProperty, getPropertyValue, getPrototype, getTemplate, getX, getXPath, getY, hasFlag, importInto, isPropertyLocal, removeListener, setCommandManager, setProperties, setProperty, setPropertyFromPath
-
-
-
-
Field Detail
-
source
protected AbstractLocation source
-
target
protected AbstractLocation target
-
-
Constructor Detail
-
Edge
public Edge(Element prototype)
Constructs an Edge based on a prototype. Use Template#createEdge() instead and then insert it into Template.- Parameters:
prototype- the element containing default properties.- See Also:
Template.createEdge(),Element.importInto(com.uppaal.model.core2.Element)
-
-
Method Detail
-
getSource
public AbstractLocation getSource()
Returns the source location (the beginning of the edge).- Returns:
- abstract location (can be BranchPoint)
-
getTarget
public AbstractLocation getTarget()
Returns the target location (the end of the edge).- Returns:
- abstract location (can be BranchPoint)
-
getNails
public Nail getNails()
Returns the first nail (if any).- Returns:
- nail or null if there are no nails on this edge.
-
setSource
public void setSource(AbstractLocation source)
Sets the origin of this edge.- Parameters:
source- the origin: Location or BranchPoint
-
setTarget
public void setTarget(AbstractLocation target)
Sets the destination of this edge.- Parameters:
target- the destination: Location or BranchPoint
-
createNail
public Nail createNail()
Creates a nail based on prototype, the nail has to be inserted into an edge.- Returns:
- a new nail
-
accept
public void accept(Visitor visitor) throws java.lang.Exception
Description copied from class:ElementAccept a visitor. This method is specialized in every subclass. Part of the visitor pattern.
-
getPrototypeFromParent
public Element getPrototypeFromParent(Element parent)
Returns the #edge property value of the parent argument.- Overrides:
getPrototypeFromParentin classElement- Parameters:
parent- - The parent element- Returns:
- The property element
-
getName
public java.lang.String getName()
Constructs a human-friendly name of this edge. The result contains a source and target location names separated by an arrow.- Returns:
- a human-friendly name for this edge
-
getXMLLabelKinds
public java.lang.String[] getXMLLabelKinds()
Description copied from class:ElementReturns possible XML label kinds this element supports.- Overrides:
getXMLLabelKindsin classElement- Returns:
-
-