Class FindResult

java.lang.Object
com.j3d.engine.scene.find.FindResult

public class FindResult extends Object
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 Details

    • layer

      private Layer layer
    • layerIndex

      private int layerIndex
    • thing

      private Thing thing
    • thingIndex

      private int thingIndex
    • gObject

      private GObject gObject
    • gObjectIndex

      private int gObjectIndex
    • empty

      private boolean empty
  • Constructor Details

    • FindResult

      protected FindResult()
    • FindResult

      protected FindResult(Layer l, int i)
    • FindResult

      protected FindResult(Layer l, int i, Thing t, int f)
    • FindResult

      protected FindResult(Layer l, int i, Thing t, int f, GObject g, int j)
  • 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

      public GObject 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

      public Layer 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

      public Thing getThing()
      Returns the found Thing.
      Returns:
      The Thing, or null if no Thing was found.