[jboss-svn-commits] JBoss Common SVN: r2217 - common-core/trunk/src/main/java/org/jboss/util/graph
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 12 21:07:46 EST 2006
Author: scott.stark at jboss.org
Date: 2006-12-12 21:07:44 -0500 (Tue, 12 Dec 2006)
New Revision: 2217
Modified:
common-core/trunk/src/main/java/org/jboss/util/graph/Edge.java
Log:
Update javadoc
Modified: common-core/trunk/src/main/java/org/jboss/util/graph/Edge.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/graph/Edge.java 2006-12-13 01:28:37 UTC (rev 2216)
+++ common-core/trunk/src/main/java/org/jboss/util/graph/Edge.java 2006-12-13 02:07:44 UTC (rev 2217)
@@ -34,57 +34,89 @@
private int cost;
private boolean mark;
- // Create an edge with 0 cost
- public Edge(Vertex<T> one, Vertex<T> two)
+ /**
+ * Create a zero cost edge between from and to
+ * @param from the starting vertex
+ * @param to the ending vertex
+ */
+ public Edge(Vertex<T> from, Vertex<T> to)
{
- from = one;
- to = two;
- cost = 0;
- mark = false;
+ this(from, to, 0);
}
- // Create an edge and define the cost
- public Edge(Vertex<T> one, Vertex<T> two, int c)
+ /**
+ * Create an edge between from and to with the given cost.
+ *
+ * @param from the starting vertex
+ * @param to the ending vertex
+ * @param cost the cost of the edge
+ */
+ public Edge(Vertex<T> from, Vertex<T> to, int cost)
{
- from = one;
- to = two;
- cost = c;
+ this.from = from;
+ this.to = to;
+ this.cost = cost;
mark = false;
}
+ /**
+ * Get the ending vertex
+ * @return ending vertex
+ */
public Vertex<T> getTo()
{
return to;
}
+ /**
+ * Get the starting vertex
+ * @return starting vertex
+ */
public Vertex<T> getFrom()
{
return from;
}
+ /**
+ * Get the cost of the edge
+ * @return cost of the edge
+ */
public int getCost()
{
return cost;
}
- // Mark an edge
+ /**
+ * Set the mark flag of the edge
+ *
+ */
public void mark()
{
mark = true;
}
- // Clear the mark
+ /**
+ * Clear the edge mark flag
+ *
+ */
public void clearMark()
{
mark = false;
}
- // Test the mark
+ /**
+ * Get the edge mark flag
+ * @return edge mark flag
+ */
public boolean isMarked()
{
return mark;
}
+ /**
+ * String rep of edge
+ * @return string rep with from/to vertex names and cost
+ */
public String toString()
{
StringBuffer tmp = new StringBuffer("Edge[from: ");
More information about the jboss-svn-commits
mailing list