mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetCommandViewImpl.java
private boolean containsNode(TreeNode node, String nodeName, Object nodeValue, int currentLevel, int nodeLevel) 
        throws ReflectionsUtilException
    {
        for (TreeNode child: node.getChildren())
        {
            if (currentLevel == nodeLevel)
            {
                String name = ((CommandNodeModel)child.getData()).getName();
                Object value = ((CommandNodeModel)child.getData()).getValue();
                //Null check needed since equals method is used.
                if (name.equals(nodeName) && value != null && value.equals(nodeValue))
                {
                    return true;
                }
                //This if will allow for checking if a value does equal null since the equals method is used above.
                else if (name.equals(nodeName) && value == nodeValue)
                {
                    return true;
                }
            }
            
            //Check current level first. If it is the same level as where the node should be found then there is no 
            //reason to search any deeper.
            if (currentLevel != nodeLevel && child.getChildCount() > 0)
            {
                boolean found = containsNode(child, nodeName, nodeValue, currentLevel + 1, nodeLevel);
                if (found)
                {
                    return true;
                }
            }
        }
        return false;
    }
/**
     * Method used to determine if a tree contains a specific node.
     * 
     * @param node
     *          The tree node with which to start searching at.
     * @param nodeName
     *          Name of the node to be found.
     * @param nodeValue
     *          Value the node should contain.
     * @param currentLevel
     *          Current node level within the tree.
     * @param nodeLevel
     *          Level the node will be at from the root node. (1 or greater)
     * @return
     *          True if the tree contains the specified node and false otherwise. 
     */
Method used to determine if a tree contains a specific node.

@param node
The tree node with which to start searching at.
@param nodeName
Name of the node to be found.
@param nodeValue
Value the node should contain.
@param currentLevel
Current node level within the tree.
@param nodeLevel
Level the node will be at from the root node. (1 or greater)
@return
True if the tree contains the specified node and false otherwise.
Method used to determine if a tree contains a specific node . @param node The tree node with which to start searching at . @param nodeName Name of the node to be found . @param nodeValue Value the node should contain . @param currentLevel Current node level within the tree . @param nodeLevel Level the node will be at from the root node . ( 1 or greater ) @return True if the tree contains the specified node and false otherwise .
private boolean containsNode(TreeNode node, String nodeName, Object nodeValue, int currentLevel, int nodeLevel) 
        throws ReflectionsUtilException
    {
        for (TreeNode child: node.getChildren())
        {
            if (currentLevel == nodeLevel)
            {
                String name = ((CommandNodeModel)child.getData()).getName();
                Object value = ((CommandNodeModel)child.getData()).getValue();
                if (name.equals(nodeName) && value != null && value.equals(nodeValue))
                {
                    return true;
                }
                else if (name.equals(nodeName) && value == nodeValue)
                {
                    return true;
                }
            }
            if (currentLevel != nodeLevel && child.getChildCount() > 0)
            {
                boolean found = containsNode(child, nodeName, nodeValue, currentLevel + 1, nodeLevel);
                if (found)
                {
                    return true;
                }
            }
        }
        return false;
    }
private boolean containsNode ( TreeNode node , String nodeName , Object nodeValue , int currentLevel , int nodeLevel ) throws ReflectionsUtilException { for ( TreeNode child : node . getChildren ( ) ) { if ( currentLevel == nodeLevel ) { String name = ( ( CommandNodeModel ) child . getData ( ) ) . getName ( ) ; Object value = ( ( CommandNodeModel ) child . getData ( ) ) . getValue ( ) ; if ( name . equals ( nodeName ) && value != null && value . equals ( nodeValue ) ) { return true ; } else if ( name . equals ( nodeName ) && value == nodeValue ) { return true ; } } if ( currentLevel != nodeLevel && child . getChildCount ( ) > 0 ) { boolean found = containsNode ( child , nodeName , nodeValue , currentLevel + 1 , nodeLevel ) ; if ( found ) { return true ; } } } return false ; }
Method used to determine if a tree contains a specific node.
Method used to determine if a tree contains a specific node .
//Null check needed since equals method is used. //This if will allow for checking if a value does equal null since the equals method is used above. //Check current level first. If it is the same level as where the node should be found then there is no  //reason to search any deeper.