Class Selectable

java.lang.Object
com.yahoo.vespa.objects.Selectable
Direct Known Subclasses:
Identifiable

public class Selectable extends Object
A node in a traversable tree. Every non leaf Object implements selectMembers(ObjectPredicate, ObjectOperation) implementing the actual traversal. You can then implement an ObjectPredicate to select which nodes you want to look at with your ObjectOperation
Author:
baldersheim
  • Constructor Details

    • Selectable

      public Selectable()
  • Method Details

    • select

      public final void select(ObjectPredicate predicate, ObjectOperation operation)
      Applies the predicate to this object. If the predicate returns true, pass this object to the operation, otherwise invoke the selectMembers(ObjectPredicate, ObjectOperation) method to locate sub-elements that might trigger the predicate.
      Parameters:
      predicate - component used to select (sub-)objects
      operation - component performing some operation on the selected (sub-)objects
    • selectMembers

      public void selectMembers(ObjectPredicate predicate, ObjectOperation operation)
      Invokes select(ObjectPredicate, ObjectOperation) on any member objects this object wants to expose through the selection mechanism. Overriding this method is optional, and which objects to expose is determined by the application logic of the object itself.
      Parameters:
      predicate - component used to select (sub-)objects
      operation - component performing some operation on the selected (sub-)objects
    • select

      public static void select(Selectable selectable, ObjectPredicate predicate, ObjectOperation operation)