Interface Cell<T,N extends javafx.scene.Node>

All Known Implementing Classes:
CellWrapper
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Cell<T,N extends javafx.scene.Node>
Provides efficient memory usage by wrapping a Node within this object and reusing it when isReusable() is true.
  • Method Details

    • wrapNode

      static <T, N extends javafx.scene.Node> Cell<T,N> wrapNode(N node)
    • getNode

      N getNode()
    • isReusable

      default boolean isReusable()
      Indicates whether this cell can be reused to display different items.

      Default implementation returns false.

    • updateItem

      default void updateItem(T item)
      If this cell is reusable (as indicated by isReusable()), this method is called to display a different item. reset() will have been called before a call to this method.

      The default implementation throws UnsupportedOperationException.

      Parameters:
      item - the new item to display
    • updateIndex

      default void updateIndex(int index)
      Called to update index of a visible cell.

      Default implementation does nothing.

    • reset

      default void reset()
      Called when this cell is no longer used to display its item. If this cell is reusable, it may later be asked to display a different item by a call to updateItem(Object).

      Default implementation does nothing.

    • dispose

      default void dispose()
      Called when this cell is no longer going to be used at all. reset() will have been called before this method is invoked.

      Default implementation does nothing.

    • beforeDispose

      default Cell<T,N> beforeDispose(Runnable action)
    • afterDispose

      default Cell<T,N> afterDispose(Runnable action)
    • beforeReset

      default Cell<T,N> beforeReset(Runnable action)
    • afterReset

      default Cell<T,N> afterReset(Runnable action)
    • beforeUpdateItem

      default Cell<T,N> beforeUpdateItem(Consumer<? super T> action)
    • afterUpdateItem

      default Cell<T,N> afterUpdateItem(Consumer<? super T> action)
    • beforeUpdateIndex

      default Cell<T,N> beforeUpdateIndex(IntConsumer action)
    • afterUpdateIndex

      default Cell<T,N> afterUpdateIndex(IntConsumer action)