/** @see Graph#edgesOf(Object) */ public Set<E> edgesOf(V vertex) { ArrayUnenforcedSet<E> inAndOut = new ArrayUnenforcedSet<E>(getEdgeContainer(vertex).incoming); inAndOut.addAll(getEdgeContainer(vertex).outgoing); // we have two copies for each self-loop - remove one of them. if (allowingLoops) { Set<E> loops = getAllEdges(vertex, vertex); for (int i = 0; i < inAndOut.size(); ) { Object e = inAndOut.get(i); if (loops.contains(e)) { inAndOut.remove(i); loops.remove(e); // so we remove it only once } else { i++; } } } return Collections.unmodifiableSet(inAndOut); }
/** * . * * @param e */ public void removeEdge(EE e) { vertexEdges.remove(e); }
/** * . * * @param e */ public void removeOutgoingEdge(EE e) { outgoing.remove(e); }
/** * . * * @param e */ public void removeIncomingEdge(EE e) { incoming.remove(e); }