public QueryTreeElement getElementQuery ( String element , String group ) { QueryTreeElement node = null ; Enumeration < TreeNode > elements = root . children ( ) ; while ( elements . hasMoreElements ( ) ) { TreeElement currentNode = ( TreeElement ) elements . nextElement ( ) ; if ( currentNode instanceof QueryGroupTreeElement && currentNode . getID ( ) . equals ( group ) ) { QueryGroupTreeElement groupTElement = ( QueryGroupTreeElement ) currentNode ; Enumeration < TreeNode > queries = groupTElement . children ( ) ; while ( queries . hasMoreElements ( ) ) { QueryTreeElement queryTElement = ( QueryTreeElement ) queries . nextElement ( ) ; if ( queryTElement . getID ( ) . equals ( element ) ) { node = queryTElement ; break ; } } } else { continue ; } } return node ; }
Search a query node in a group and returns the object else returns null .