Class Hierarchy

java.lang.Object
tripleplay.ui.util.Hierarchy

public class Hierarchy extends Object
A view for the hierarchical structure of an Element.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Iterates over the ancestors of an element.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Element<?>
    The element that is the focus of this view.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hierarchy(Element<?> elem)
    Creates a new view focused on the given element.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an object to iterate over the ancestors of this hierarchy, including the root.
    Applies the given operation to the root of the hierarchy and to every proper descendant.
    boolean
    hasDescendant(Element<?> descendant)
    Tests if the given element is a proper descendant contained in this hierarchy, or is the root.
    static Hierarchy
    of(Element<?> elem)
    Create a new view of the given element.

    Methods inherited from class java.lang.Object

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

    • elem

      public final Element<?> elem
      The element that is the focus of this view.
  • Constructor Details

    • Hierarchy

      public Hierarchy(Element<?> elem)
      Creates a new view focused on the given element.
  • Method Details

    • of

      public static Hierarchy of(Element<?> elem)
      Create a new view of the given element.
    • hasDescendant

      public boolean hasDescendant(Element<?> descendant)
      Tests if the given element is a proper descendant contained in this hierarchy, or is the root.
    • ancestors

      public Iterable<Element<?>> ancestors()
      Returns an object to iterate over the ancestors of this hierarchy, including the root.
    • apply

      public Hierarchy apply(ElementOp<Element<?>> op)
      Applies the given operation to the root of the hierarchy and to every proper descendant.