changes from review

This commit is contained in:
ghidravore 2019-11-15 18:33:14 -05:00
parent b5a7246523
commit 6770c63302
3 changed files with 16 additions and 9 deletions

View file

@ -54,13 +54,15 @@ import util.CollectionUtils;
* i.e., new nodes are created), then, by default, the expanded and selected state
* feature will be unable to find the correct nodes, since the default <tt>equals()</tt>
* method on <tt>GTreeNode</tt> performs a comparison based upon instances. To fix this problem,
* the {@link #equals()} method has been implemented such that nodes are considered equals if they have
* the same name. The {@link #hashCode()} method will return the hash of the name.
* the {@link #equals()} method has been implemented such that nodes are considered equal if they have
* the same name. The {@link #hashCode()} method will return the hash of the name. The name
* attribute was chosen because it should be the most unique and descriptive piece of information
* available in a generic GTreeNode.
* <p><br>
* <p>
* There are two situations where the {@link #equals(Object)} and {@link #hashCode()} using the
* name are insufficient. One is if your tree implementation allows nodes with the same name
* with the same parent. The other possible situation is if your nodes can change their name,
* with the same parent. The other possible situation is if your nodes can change their name,
* which may confuse the tree. If either of these situations apply, just override the
* {@link #equals(Object)} and {@link #hashCode()} methods to make them more robust.
* <p><br>
@ -190,7 +192,9 @@ public abstract class GTreeNode extends CoreGTreeNode implements Comparable<GTre
}
/**
* Returns the total number of leaf nodes in the subtree from this node
* Returns the total number of leaf nodes in the subtree from this node. Note that if any
* nodes are "lazy" (see {@link GTreeLazyNode}) and not currently loaded, then it will be
* considered as a leaf and return 1.
* @return the total number of leaf nodes in the subtree from this node
*/
public int getLeafCount() {