public class GraphType extends java.lang.Object implements XmlOutputMethods
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_ROOT_ELEMENT |
protected java.lang.String |
initialManeuver |
protected java.util.LinkedHashMap<java.lang.String,Maneuver> |
maneuvers |
protected java.util.LinkedHashMap<java.lang.String,TransitionType> |
transitions |
Constructor and Description |
---|
GraphType()
Null constructor
|
GraphType(java.lang.String xml) |
Modifier and Type | Method and Description |
---|---|
void |
addManeuver(Maneuver maneuver) |
void |
addManeuver(Maneuver maneuver,
boolean clearInitialManeuverFlagIfOtherMAneuverIsSetToInitial)
Adds the given maneuver to this graph
If no maneuver has been added yet, then
this maneuver is set to be the initial maneuver
|
void |
addManeuverAtEnd(Maneuver maneuver) |
TransitionType |
addTransition(java.lang.String sourceManeuverID,
java.lang.String targetManeuverID,
java.lang.Object condition)
Adds a new transition to this graph (between two maneuver nodes)
|
TransitionType |
addTransition(java.lang.String sourceManeuverID,
java.lang.String targetManeuverID,
java.lang.Object condition,
java.lang.Object action) |
TransitionType |
addTransition(java.lang.String id,
java.lang.String sourceManeuverID,
java.lang.String targetManeuverID,
java.lang.Object condition) |
TransitionType |
addTransition(java.lang.String id,
java.lang.String sourceManeuverID,
java.lang.String targetManeuverID,
java.lang.Object condition,
java.lang.Object action)
Adds a new transition to this graph (between two maneuver nodes)
|
void |
addTransition(TransitionType tt) |
org.dom4j.Document |
asDocument() |
org.dom4j.Document |
asDocument(java.lang.String rootElementName) |
org.dom4j.Document |
asDocument2(java.lang.String rootElementName) |
org.dom4j.Element |
asElement() |
org.dom4j.Element |
asElement(java.lang.String rootElementName) |
java.lang.String |
asXML()
Este problema foi resolvido com a versão 1.6.1 do DOM4J.
|
java.lang.String |
asXML(java.lang.String rootElementName)
Este problema foi resolvido com a versão 1.6.1 do DOM4J.
|
void |
clear() |
GraphType |
clone() |
TransitionType[] |
getAllEdges()
Returns an array with all the maneuvers in the current graph
|
Maneuver[] |
getAllManeuvers()
Returns an array with all the maneuvers in the current graph
|
java.util.Vector<TransitionType> |
getExitingTransitions(Maneuver man) |
Maneuver |
getFollowingManeuver(java.lang.String maneuverID) |
java.util.LinkedList<Maneuver> |
getGraphAsManeuversList() |
java.lang.String |
getGraphAsManeuversSeq() |
java.util.Vector<TransitionType> |
getIncomingTransitions(Maneuver man) |
java.lang.String |
getInitialManeuverId()
Return the identifier of the initial maneuver (state) of the graph
|
Maneuver |
getLastManeuver() |
Maneuver |
getManeuver(java.lang.String maneuverID)
Returns the maneuver object identified by the string argument
or null if no such maneuver exists
|
Maneuver[] |
getManeuversSequence() |
Maneuver[] |
getManeuversSequence(Maneuver startManeuver) |
Maneuver[] |
getPreviousManeuvers(java.lang.String maneuverID) |
java.lang.String[] |
getReacheableManeuvers(java.lang.String sourceManeuverID)
Returns all the maneuvers that can be directly reached from the
source maneuver given
|
TransitionType |
getTransition(java.lang.String sourceId,
java.lang.String targetId) |
java.lang.Object |
getTransitionCondition(java.lang.String sourceManeuverID,
java.lang.String targetManeuverID)
Returns the transition condition (guard) between the given maneuvers
Null is returned if a transition between the maneuvers doesn't exist
|
java.util.LinkedHashMap<java.lang.String,TransitionType> |
getTransitions() |
boolean |
isSaveGotoSequenceAsTrajectory() |
boolean |
load(java.lang.String xml) |
void |
removeManeuver(Maneuver maneuver) |
TransitionType |
removeTransition(java.lang.String sourceManeuverID,
java.lang.String targetManeuverID) |
void |
removeTransition(TransitionType transition) |
void |
setInitialManeuver(java.lang.String initialManeuverId)
Changes the initial maneuver to be the maneuver with the given identifier
|
void |
setSaveGotoSequenceAsTrajectory(boolean saveGotoSequenceAsTrajectory) |
protected static final java.lang.String DEFAULT_ROOT_ELEMENT
protected java.util.LinkedHashMap<java.lang.String,Maneuver> maneuvers
protected java.util.LinkedHashMap<java.lang.String,TransitionType> transitions
protected java.lang.String initialManeuver
public GraphType()
public GraphType(java.lang.String xml)
xml
- public java.util.Vector<TransitionType> getExitingTransitions(Maneuver man)
public java.util.Vector<TransitionType> getIncomingTransitions(Maneuver man)
public boolean load(java.lang.String xml)
xml
- public void addManeuver(Maneuver maneuver)
public void addManeuverAtEnd(Maneuver maneuver)
public void addManeuver(Maneuver maneuver, boolean clearInitialManeuverFlagIfOtherMAneuverIsSetToInitial)
maneuver
- The new maneuver to be added to the current graphpublic void removeManeuver(Maneuver maneuver)
public Maneuver getManeuver(java.lang.String maneuverID)
maneuverID
- The string identifier of the maneuver to returnpublic TransitionType addTransition(java.lang.String sourceManeuverID, java.lang.String targetManeuverID, java.lang.Object condition)
sourceManeuverID
- The source node idtargetManeuverID
- The target node idcondition
- The transition condition (guard)public TransitionType addTransition(java.lang.String sourceManeuverID, java.lang.String targetManeuverID, java.lang.Object condition, java.lang.Object action)
public TransitionType addTransition(java.lang.String id, java.lang.String sourceManeuverID, java.lang.String targetManeuverID, java.lang.Object condition)
public TransitionType addTransition(java.lang.String id, java.lang.String sourceManeuverID, java.lang.String targetManeuverID, java.lang.Object condition, java.lang.Object action)
id
- ID of the transitionsourceManeuverID
- The source node idtargetManeuverID
- The target node idcondition
- The transition condition (guard)action
- The transition action (outputs)public void removeTransition(TransitionType transition)
public void addTransition(TransitionType tt)
public TransitionType removeTransition(java.lang.String sourceManeuverID, java.lang.String targetManeuverID)
public java.lang.String[] getReacheableManeuvers(java.lang.String sourceManeuverID)
sourceManeuverID
- The maneuver to test for transitionspublic java.lang.Object getTransitionCondition(java.lang.String sourceManeuverID, java.lang.String targetManeuverID)
sourceManeuverID
- The maneuver id of the transition origintargetManeuverID
- The maneuver id of the transition destinypublic TransitionType getTransition(java.lang.String sourceId, java.lang.String targetId)
public Maneuver[] getAllManeuvers()
public TransitionType[] getAllEdges()
public Maneuver[] getManeuversSequence()
public Maneuver getLastManeuver()
public Maneuver getFollowingManeuver(java.lang.String maneuverID)
public Maneuver[] getPreviousManeuvers(java.lang.String maneuverID)
public java.lang.String getGraphAsManeuversSeq()
public java.util.LinkedList<Maneuver> getGraphAsManeuversList()
public java.lang.String asXML()
XmlOutputMethods
FileUtil.saveToFile(String, String)
e afins. Isto porque ao gravar como UTF-8
os caracteres são adulterados guardando por exemplo "é" em 2 caracteres (ou seja pega nos dois caracteres UTF-8 e
transforma-os em 2 UTF-8s).asXML
in interface XmlOutputMethods
public java.lang.String asXML(java.lang.String rootElementName)
XmlOutputMethods
FileUtil.saveToFile(String, String)
e afins. Isto porque ao gravar como UTF-8
os caracteres são adulterados guardando por exemplo "é" em 2 caracteres (ou seja pega nos dois caracteres UTF-8 e
transforma-os em 2 UTF-8s).asXML
in interface XmlOutputMethods
public org.dom4j.Element asElement()
asElement
in interface XmlOutputMethods
public org.dom4j.Element asElement(java.lang.String rootElementName)
asElement
in interface XmlOutputMethods
public org.dom4j.Document asDocument()
asDocument
in interface XmlOutputMethods
public org.dom4j.Document asDocument(java.lang.String rootElementName)
asDocument
in interface XmlOutputMethods
public org.dom4j.Document asDocument2(java.lang.String rootElementName)
public java.lang.String getInitialManeuverId()
public void setInitialManeuver(java.lang.String initialManeuverId)
public boolean isSaveGotoSequenceAsTrajectory()
public void setSaveGotoSequenceAsTrajectory(boolean saveGotoSequenceAsTrajectory)
public GraphType clone()
clone
in class java.lang.Object
public void clear()
public java.util.LinkedHashMap<java.lang.String,TransitionType> getTransitions()
Copyright © 2004-2018 FEUP-LSTS and Neptus developers. All Rights Reserved.