private void addEdgeInternal(int direction, StatEdge edge) { int type = edge.getType(); int[] arrtypes; if (type == StatEdge.TYPE_EXCEPTION) { arrtypes = new int[]{STATEDGE_ALL, StatEdge.TYPE_EXCEPTION}; } else { arrtypes = new int[]{STATEDGE_ALL, STATEDGE_DIRECT_ALL, type}; } for (int edgetype : arrtypes) { addEdgeDirectInternal(direction, edge, edgetype); } }
public void changeEdgeType(int direction, StatEdge edge, int newtype) { int oldtype = edge.getType(); if (oldtype == newtype) { return; } if (oldtype == StatEdge.TYPE_EXCEPTION || newtype == StatEdge.TYPE_EXCEPTION) { throw new RuntimeException("Invalid edge type!"); } removeEdgeDirectInternal(direction, edge, oldtype); addEdgeDirectInternal(direction, edge, newtype); if (direction == DIRECTION_FORWARD) { edge.getDestination().changeEdgeType(DIRECTION_BACKWARD, edge, newtype); } edge.setType(newtype); }
private void addEdgeInternal(int direction, StatEdge edge) { int type = edge.getType(); int[] arrtypes; if (type == StatEdge.TYPE_EXCEPTION) { arrtypes = new int[]{STATEDGE_ALL, StatEdge.TYPE_EXCEPTION}; } else { arrtypes = new int[]{STATEDGE_ALL, STATEDGE_DIRECT_ALL, type}; } for (int edgetype : arrtypes) { addEdgeDirectInternal(direction, edge, edgetype); } }
public void changeEdgeType(int direction, StatEdge edge, int newtype) { int oldtype = edge.getType(); if (oldtype == newtype) { return; } if (oldtype == StatEdge.TYPE_EXCEPTION || newtype == StatEdge.TYPE_EXCEPTION) { throw new RuntimeException("Invalid edge type!"); } removeEdgeDirectInternal(direction, edge, oldtype); addEdgeDirectInternal(direction, edge, newtype); if (direction == DIRECTION_FORWARD) { edge.getDestination().changeEdgeType(DIRECTION_BACKWARD, edge, newtype); } edge.setType(newtype); }