Package com.j3d.engine.scene.find
Class FindResult
java.lang.Object
com.j3d.engine.scene.find.FindResult
A container class for the results of a search operation performed by the
Finder.
It encapsulates a found Layer, Thing, or GObject, along with their
hierarchical indices, providing a structured way to return search outcomes.
An empty FindResult indicates that no object matching the query was found.- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedFindResult(Layer l, int i) protectedFindResult(Layer l, int i, Thing t, int f) protectedFindResult(Layer l, int i, Thing t, int f, GObject g, int j) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this FindResult contains a GObject.booleanChecks if this FindResult contains a Layer.booleanChecks if this FindResult contains a Thing.Returns the found GObject.intReturns the index of the found GObject within its parent Thing.getLayer()Returns the found Layer.intReturns the index of the found Layer.getThing()Returns the found Thing.intReturns the index of the found Thing within its parent Layer.booleanisEmpty()Checks if this FindResult is empty, meaning it was created without any found objects.
-
Field Details
-
layer
-
layerIndex
private int layerIndex -
thing
-
thingIndex
private int thingIndex -
gObject
-
gObjectIndex
private int gObjectIndex -
empty
private boolean empty
-
-
Constructor Details
-
FindResult
protected FindResult() -
FindResult
-
FindResult
-
FindResult
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if this FindResult is empty, meaning it was created without any found objects.- Returns:
- true if the result is empty, false otherwise.
-
containsLayer
public boolean containsLayer()Checks if this FindResult contains a Layer.- Returns:
- true if a Layer is present, false otherwise.
-
containsThing
public boolean containsThing()Checks if this FindResult contains a Thing.- Returns:
- true if a Thing is present, false otherwise.
-
containsGObject
public boolean containsGObject()Checks if this FindResult contains a GObject.- Returns:
- true if a GObject is present, false otherwise.
-
getgObjectIndex
public int getgObjectIndex()Returns the index of the found GObject within its parent Thing.- Returns:
- The index of the GObject, or -1 if no GObject was found or its index is not set.
-
getgObject
Returns the found GObject.- Returns:
- The GObject, or null if no GObject was found.
-
getLayerIndex
public int getLayerIndex()Returns the index of the found Layer.- Returns:
- The index of the Layer, or -1 if no Layer was found or its index is not set.
-
getLayer
Returns the found Layer.- Returns:
- The Layer, or null if no Layer was found.
-
getThingIndex
public int getThingIndex()Returns the index of the found Thing within its parent Layer.- Returns:
- The index of the Thing, or -1 if no Thing was found or its index is not set.
-
getThing
Returns the found Thing.- Returns:
- The Thing, or null if no Thing was found.
-