Class ElementOp<T extends Element<?>>

java.lang.Object
tripleplay.ui.util.ElementOp<T>
Type Parameters:
T - the leaf type of Element.

public abstract class ElementOp<T extends Element<?>> extends Object
Defines a method that applies an operation to an element.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    apply(T elem)
    Applies an arbitrary operation to the given element.
    final void
    applyToEach(Iterable<? extends T> elems)
    Iterates the given elements and applies this operation to each.
    static ElementOp<Element<?>>
    setEnabled(boolean enabled)
    Returns an element operation that enables or disables its elements.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ElementOp

      public ElementOp()
  • Method Details

    • setEnabled

      public static ElementOp<Element<?>> setEnabled(boolean enabled)
      Returns an element operation that enables or disables its elements. Usage:
      
           Hierarchy.of(elem).apply(ElementOp.setEnabled(false));
       
    • apply

      public abstract void apply(T elem)
      Applies an arbitrary operation to the given element.
    • applyToEach

      public final void applyToEach(Iterable<? extends T> elems)
      Iterates the given elements and applies this operation to each.