/** * @throws IllegalArgumentException if src or dst is null */ public void addNormalEdge(T src, T dst) { if (src == null) { throw new IllegalArgumentException("src is null"); } if (dst == null) { throw new IllegalArgumentException("dst is null"); } if (dst.equals(exit())) { normalToExit.set(getNumber(src)); } else if (getNumber(dst) == (getNumber(src) + 1)) { fallThru.set(getNumber(src)); } else { normalEdgeManager.addEdge(src, dst); } }
/** * @throws IllegalArgumentException if src or dst is null */ public void addNormalEdge(T src, T dst) { if (src == null) { throw new IllegalArgumentException("src is null"); } if (dst == null) { throw new IllegalArgumentException("dst is null"); } if (dst.equals(exit())) { normalToExit.set(getNumber(src)); } else if (getNumber(dst) == (getNumber(src) + 1)) { fallThru.set(getNumber(src)); } else { normalEdgeManager.addEdge(src, dst); } }
/** * @throws IllegalArgumentException if dst is null */ public void addExceptionalEdge(T src, T dst) { if (dst == null) { throw new IllegalArgumentException("dst is null"); } if (dst.equals(exit())) { exceptionalToExit.set(getNumber(src)); } else { exceptionalEdgeManager.addEdge(src, dst); SimpleIntVector v = exceptionalSuccessors.get(getNumber(src)); if (v == null) { v = new SimpleIntVector(-1); exceptionalSuccessors.set(getNumber(src), v); v.set(0, getNumber(dst)); return; } if (v.get(v.getMaxIndex()) != getNumber(dst)) { v.set(v.getMaxIndex() + 1, getNumber(dst)); } } }
/** * @throws IllegalArgumentException if dst is null */ public void addExceptionalEdge(T src, T dst) { if (dst == null) { throw new IllegalArgumentException("dst is null"); } if (dst.equals(exit())) { exceptionalToExit.set(getNumber(src)); } else { exceptionalEdgeManager.addEdge(src, dst); SimpleIntVector v = exceptionalSuccessors.get(getNumber(src)); if (v == null) { v = new SimpleIntVector(-1); exceptionalSuccessors.set(getNumber(src), v); v.set(0, getNumber(dst)); return; } if (v.get(v.getMaxIndex()) != getNumber(dst)) { v.set(v.getMaxIndex() + 1, getNumber(dst)); } } }