Package jadex.tools.comanalyzer.graph
Class MessageNumberIndexFunction
- java.lang.Object
-
- jadex.tools.comanalyzer.graph.MessageNumberIndexFunction
-
- All Implemented Interfaces:
edu.uci.ics.jung.graph.util.EdgeIndexFunction
public class MessageNumberIndexFunction extends java.lang.Object implements edu.uci.ics.jung.graph.util.EdgeIndexFunction
A class which creates and maintains indices for the edges so that parallel edges are sorted. In this case the edges are sorted by the sequence number of the message. This only applies for the directed multigraph because in any other case only one message is in the edge (message group).
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map
edge_index
The map of edge indices
-
Constructor Summary
Constructors Constructor Description MessageNumberIndexFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getIndex(edu.uci.ics.jung.graph.Graph graph, GraphCanvas.MessageGroup e, GraphCanvas.AgentGroup v)
Returns the index for the message group.protected int
getIndex(edu.uci.ics.jung.graph.Graph graph, GraphCanvas.MessageGroup group, GraphCanvas.AgentGroup agents1, GraphCanvas.AgentGroup agents2)
Returns the index for the message group.int
getIndex(edu.uci.ics.jung.graph.Graph graph, java.lang.Object group)
Returns the index for the specified message group.void
reset()
Clears all edge indices for all edges in all graphs.void
reset(edu.uci.ics.jung.graph.Graph graph, java.lang.Object group)
Resets the indices for this edge group and its parallel groups.
-
-
-
Method Detail
-
getIndex
public int getIndex(edu.uci.ics.jung.graph.Graph graph, java.lang.Object group)
Returns the index for the specified message group. Calculates the indices for the current group and for all groups parallel to this group. Only groups with only one containing message are considered.- Specified by:
getIndex
in interfaceedu.uci.ics.jung.graph.util.EdgeIndexFunction
- Parameters:
graph
- The graph.group
- The message group.- Returns:
- The index for the message group.
-
reset
public void reset(edu.uci.ics.jung.graph.Graph graph, java.lang.Object group)
Resets the indices for this edge group and its parallel groups. Should be invoked when an edge parallel to the group has been added or removed.- Specified by:
reset
in interfaceedu.uci.ics.jung.graph.util.EdgeIndexFunction
- Parameters:
group
-
-
reset
public void reset()
Clears all edge indices for all edges in all graphs. Does not recalculate the indices.- Specified by:
reset
in interfaceedu.uci.ics.jung.graph.util.EdgeIndexFunction
-
getIndex
protected int getIndex(edu.uci.ics.jung.graph.Graph graph, GraphCanvas.MessageGroup group, GraphCanvas.AgentGroup agents1, GraphCanvas.AgentGroup agents2)
Returns the index for the message group.- Parameters:
graph
- The graph.group
- The message group.agents1
- The first agent group.agents2
- The second agent group.- Returns:
- The index of the message group.
-
getIndex
protected int getIndex(edu.uci.ics.jung.graph.Graph graph, GraphCanvas.MessageGroup e, GraphCanvas.AgentGroup v)
Returns the index for the message group.- Parameters:
graph
- The graph.e
- The message group.v
- The agent group.- Returns:
- The index of the group.
-
-