com.uppaal.model.core2
Class Edge

java.lang.Object
  extended by com.uppaal.model.core2.Element
      extended by com.uppaal.model.core2.Node
          extended by com.uppaal.model.core2.Edge
All Implemented Interfaces:
Serializable, Cloneable

public class Edge
extends Node

Edge models discrete transitions between locations.

An Edge may have Nails as children in the Node.

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".

See Also:
Nail, BranchPoint, Location, Element.getPropertyValue(java.lang.String), Element.hasFlag(java.lang.String), Serialized Form

Field Summary
protected  AbstractLocation source
           
protected  AbstractLocation target
           
 
Fields inherited from class com.uppaal.model.core2.Node
first, next, previous
 
Fields inherited from class com.uppaal.model.core2.Element
listeners, properties, prototype
 
Constructor Summary
Edge(Element prototype)
          Constructs an Edge based on a prototype.
 
Method Summary
 void accept(Visitor visitor)
          Accept a visitor.
 Nail createNail()
          Creates a nail based on prototype, the nail has to be inserted into an edge.
 Nail getNails()
          Returns the first nail (if any).
 Element getPrototypeFromParent(Element parent)
          Returns the #edge property value of the parent argument.
 AbstractLocation getSource()
          Returns the source location (the beginning of the edge).
 AbstractLocation getTarget()
          Returns the target location (the end of the edge).
 void setSource(AbstractLocation source)
          Sets the origin of this edge.
 void setTarget(AbstractLocation target)
          Sets the destination of this edge.
 
Methods inherited from class com.uppaal.model.core2.Node
clone, getFirst, getLast, getNext, getPrevious, insert, move, remove, setPrototype
 
Methods inherited from class com.uppaal.model.core2.Element
acceptSafe, addListener, getColor, getDocument, getLocalProperty, getParent, getProperties, getProperty, getPropertyValue, getPrototype, getTemplate, getX, getY, hasFlag, importInto, isPropertyLocal, removeListener, setProperties, setProperty, setPropertyFromPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 Exception
Description copied from class: Element
Accept a visitor. This method is specialised in every subclass. Part of the visitor pattern.

Overrides:
accept in class Node
Throws:
Exception

getPrototypeFromParent

public Element getPrototypeFromParent(Element parent)
Returns the #edge property value of the parent argument.

Overrides:
getPrototypeFromParent in class Element


Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.