All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.Search
java.lang.Object
|
+----att.grappa.Search
- public class Search
- extends Object
- implements GraphEnumeration
This class generates an enumeration of graph elements that satisfy
the search criteria supplied at creation.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
AND_ATTRS
- Used to indicate a search of a set of element attributes
-
ATTR
- Used to indicate a search of element attributes
-
ID
- Used to indicate a search of element IDs
-
NAME
- Used to indicate a search of element names
-
OR_ATTRS
- Used to indicate a search of any of a set of element attributes
-
TAG
- Used to indicate a search of element tags
-
Search(GraphEnumeration, int, Object)
- Perform a search of elements in the supplied enumeration.
-
Search(Subgraph, int, int, Object)
- Perform a search of elements in the defined enumeration.
-
findById(Graph, Long)
- Search a graph for an element ID.
-
getEnumerationTypes()
- Get the types of elements possibly contained in this enumeration.
-
getSearchObject()
- Get the search object for this
Search
instance.
-
getSearchType()
- Get the search type for this
Search
instance.
-
getSubgraphRoot()
- Get the root of this enumeration.
-
hasMoreElements()
- Tests if this enumeration contains more elements.
-
nextElement()
- Returns the next element of this enumeration.
-
nextGraphElement()
- A convenience method that just returns a cast of a call to nextElement().
ID
public static final int ID
- Used to indicate a search of element IDs
NAME
public static final int NAME
- Used to indicate a search of element names
TAG
public static final int TAG
- Used to indicate a search of element tags
ATTR
public static final int ATTR
- Used to indicate a search of element attributes
AND_ATTRS
public static final int AND_ATTRS
- Used to indicate a search of a set of element attributes
OR_ATTRS
public static final int OR_ATTRS
- Used to indicate a search of any of a set of element attributes
Search
public Search(GraphEnumeration elemEnum,
int searchType,
Object searchObject)
- Perform a search of elements in the supplied enumeration.
- Parameters:
- elemEnum - the enumeration of elements to be searched
- searchType - the type of search to perform
- searchObject - the search object to match against
- See Also:
- ID, NAME, TAG, ATTR, AND_ATTRS, OR_ATTRS
Search
public Search(Subgraph root,
int elemTypes,
int searchType,
Object searchObject)
- Perform a search of elements in the defined enumeration.
The enumeration to be searched is generated using the
Subgraph
elements(int)
method.
- Parameters:
- root - the root subgraph in which to begin the search
- elemTypes - the type of graph elements to search
- searchType - the type of search to perform
- searchObject - the search object to match against
- See Also:
- elements, NODE, EDGE, SUBGRAPH, ID, NAME, TAG, ATTR, AND_ATTRS, OR_ATTRS
hasMoreElements
public boolean hasMoreElements()
- Tests if this enumeration contains more elements.
- Returns:
-
true
if this enumeration contains more elements;
false
otherwise.
nextElement
public Object nextElement() throws NoSuchElementException
- Returns the next element of this enumeration.
- Returns:
- the next element of this enumeration.
- Throws: NoSuchElementException
- if no more elements exist.
getSearchObject
public Object getSearchObject()
- Get the search object for this
Search
instance.
- Returns:
- the search object
getSearchType
public int getSearchType()
- Get the search type for this
Search
instance.
- Returns:
- the search type
- See Also:
- ID, NAME, TAG, ATTR, AND_ATTRS, OR_ATTRS
nextGraphElement
public Element nextGraphElement() throws NoSuchElementException
- A convenience method that just returns a cast of a call to nextElement().
- Returns:
- the next graph element in the enumeration.
- Throws: NoSuchElementException
- whenever the enumeration has no more elements.
- See Also:
- nextElement
getSubgraphRoot
public Subgraph getSubgraphRoot()
- Get the root of this enumeration.
- Returns:
- the root subgraph for this enumeration.
getEnumerationTypes
public int getEnumerationTypes()
- Get the types of elements possibly contained in this enumeration.
- Returns:
- an indication of the types of elements in this enumeration
- See Also:
- NODE, EDGE, SUBGRAPH
findById
public static Element findById(Graph graph,
Long id)
- Search a graph for an element ID.
- Parameters:
- graph - the graph to be searched
- id - the element ID for which to search
- Returns:
- the matching graph element or null if no match.
- See Also:
- getId
All Packages Class Hierarchy This Package Previous Next Index