shout3d.core
Interface Searcher


public abstract interface Searcher

An interface which represents a Searcher and provides required methods. The rules for searching within NodeField and NodeArrayField values are as follows: [1] Children of Group nodes will be recursively searched. [2] For other NodeField and NodeArrayField fields, the values will be searched for a match but not recursively. (e.g., The material field of an Appearance node is searched for a match)


Method Summary
 Node[][] searchAll(Node root)
          Given the parameters that have been set, search for all nodes that meet all of the criteria.
 Node[] searchFirst(Node root)
          Given the parameters that have been set, search for the first node that meets all of the criteria.
 void setDefName(java.lang.String defNameOfNodeToSearchFor)
          Sets a particular DEF name as a criterion for searching.
 void setNode(Node nodeToSearchFor)
          Sets a particular node as a criterion for searching.
 void setType(java.lang.String typeToSearchFor)
          Sets a particular node type as a criterion for searching.
 

Method Detail

setNode

public void setNode(Node nodeToSearchFor)
Sets a particular node as a criterion for searching. This criterion will be used in combination with the others. If the criterion is null the criterion will not be used in the search.
Parameters:
nodeToSearchFor - the node to search for

setType

public void setType(java.lang.String typeToSearchFor)
Sets a particular node type as a criterion for searching. This criterion will used in combination with the others. If the criterion is null the criterion will not be used in the search.
Parameters:
typeToSearchFor - the type to search for

setDefName

public void setDefName(java.lang.String defNameOfNodeToSearchFor)
Sets a particular DEF name as a criterion for searching. This criterion will used in combination with the others. If the criterion is null the criterion will not be used in the search.
Parameters:
defNameOfNodeToSearchFor - the DEF name to search for

searchFirst

public Node[] searchFirst(Node root)
Given the parameters that have been set, search for the first node that meets all of the criteria.
Parameters:
the - root to search under
Returns:
the path to the found node

searchAll

public Node[][] searchAll(Node root)
Given the parameters that have been set, search for all nodes that meet all of the criteria.
Parameters:
the - root to search under
Returns:
the paths to the found nodes