class Cycle
extends java.lang.Object
Constructor and Description |
---|
Cycle(java.util.Set<Edge> edges)
Create a cycle from the given set of edges.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
addEdge(Edge edge)
Adds the edge to the cycle.
|
(package private) java.util.Set<Edge> |
getEdges()
Return the set of remaining edges in the cycle.
|
(package private) boolean |
isCycleBroken()
Returns whether the cycle is broken.
|
(package private) boolean |
matchesCycle(java.util.Collection<Edge> otherCycle)
Returns whether this cycle has the same edges as the given collection of edges, in any order.
|
(package private) boolean |
removeEdge(Edge edge)
Removes the given edge from the cycle.
|
Cycle(java.util.Set<Edge> edges)
edges
- The edges creating a cycle.java.util.Set<Edge> getEdges()
boolean removeEdge(Edge edge)
edge
- The edge to remove.boolean addEdge(Edge edge)
edge
- The edge to add.boolean isCycleBroken()
boolean matchesCycle(java.util.Collection<Edge> otherCycle)
otherCycle
- The collection of edges making up the other cycle.