You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2012/07/04 12:12:12 UTC
svn commit: r1357205 -
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSetNode.java
Author: simonetripodi
Date: Wed Jul 4 10:12:11 2012
New Revision: 1357205
URL: http://svn.apache.org/viewvc?rev=1357205&view=rev
Log:
added missing javadoc
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSetNode.java
Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSetNode.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSetNode.java?rev=1357205&r1=1357204&r2=1357205&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSetNode.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/DisjointSetNode.java Wed Jul 4 10:12:11 2012
@@ -28,47 +28,84 @@ final class DisjointSetNode<E>
implements Comparable<DisjointSetNode<E>>
{
+ /**
+ * The stored node value.
+ */
private final E e;
+ /**
+ * The {@code DisjointSetNode} parent node, {@code this} by default.
+ */
private DisjointSetNode<E> parent = this;
+ /**
+ * The current node rank.
+ */
private Integer rank = 0;
/**
- *
+ * Creates a new {@link DisjointSet} node with the given value.
*
- * @param e
+ * @param e the node value has to be stored.
*/
public DisjointSetNode( E e )
{
this.e = e;
}
+ /**
+ * Returns the adapted element by this node.
+ *
+ * @return the adapted element by this node.
+ */
public E getElement()
{
return e;
}
+ /**
+ * Returns the reference to the parent node, the node itself by default.
+ *
+ * @return the reference to the parent node, the node itself by default.
+ */
public DisjointSetNode<E> getParent()
{
return parent;
}
+ /**
+ * Sets the reference to a new parent node.
+ *
+ * @param parent the reference to a new parent node.
+ */
public void setParent( DisjointSetNode<E> parent )
{
this.parent = parent;
}
+ /**
+ * Returns this node rank.
+ *
+ * @return this node rank
+ */
public Integer getRank()
{
return rank;
}
+ /**
+ * Increases this node rank.
+ */
public void increaseRank()
{
rank++;
}
+ /**
+ * Sets a new different rank.
+ *
+ * @param rank the new rank to this node.
+ */
public void setRank( int rank )
{
this.rank = rank;