de.korelstar.math.graph
Class Cycle

java.lang.Object
  extended by de.korelstar.math.graph.Cycle

public class Cycle
extends java.lang.Object

Represents an cycle of a graph.


Constructor Summary
Cycle(java.util.Collection edges)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Edge getEdge(Node n)
          Gets the Edge, whose source is a certain Node
 java.util.Collection getEdges()
          Gets all edges in this cycle
 java.util.Set getNodes()
          Gets all nodes, which belong to this cycle
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cycle

public Cycle(java.util.Collection edges)
Method Detail

getEdge

public Edge getEdge(Node n)
Gets the Edge, whose source is a certain Node

Parameters:
n - Node, to which the Edge is connected
Returns:
an Edge which is connected to the Node

getNodes

public java.util.Set getNodes()
Gets all nodes, which belong to this cycle

Returns:
Set of Node

getEdges

public java.util.Collection getEdges()
Gets all edges in this cycle

Returns:
Collection of Edges

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object