@FunctionalInterface
public static interface FXUtils.GetHandler<T>
if ( condition() ) {
return action();
}
.
Here is an example to get the first child of the specified type.
public static Node getFirstChildOf(final Class clazz, Node c) {
return getRecursively(c, new GetHandler() {
public boolean condition(Node c) {
return clazz.isAssignableFrom(c.getClass());
}
public Node action(Node c) {
return c;
}
});
}
| Modifier and Type | Method and Description |
|---|---|
default java.lang.Object |
action(T c)
The action you want to perform on this Node.
|
boolean |
condition(T c)
If true, it will call
action(Object) on this Node. |
boolean condition(T c)
action(Object) on this Node.c - the Nodedefault java.lang.Object action(T c)
condition(Object)
returns true.c - the NodeFXUtils.getRecursively(Object, FXUtils.GetHandler).