Package com.yahoo.vespa.objects
Class Selectable
java.lang.Object
com.yahoo.vespa.objects.Selectable
- Direct Known Subclasses:
Identifiable
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
select
(ObjectPredicate predicate, ObjectOperation operation) Applies the predicate to this object.static void
select
(Selectable selectable, ObjectPredicate predicate, ObjectOperation operation) void
selectMembers
(ObjectPredicate predicate, ObjectOperation operation) Invokesselect(ObjectPredicate, ObjectOperation)
on any member objects this object wants to expose through the selection mechanism.
-
Constructor Details
-
Selectable
public Selectable()
-
-
Method Details
-
select
Applies the predicate to this object. If the predicate returns true, pass this object to the operation, otherwise invoke theselectMembers(ObjectPredicate, ObjectOperation)
method to locate sub-elements that might trigger the predicate.- Parameters:
predicate
- component used to select (sub-)objectsoperation
- component performing some operation on the selected (sub-)objects
-
selectMembers
Invokesselect(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-)objectsoperation
- component performing some operation on the selected (sub-)objects
-
select
public static void select(Selectable selectable, ObjectPredicate predicate, ObjectOperation operation)
-