@FunctionalInterface public interface Cell<T,N extends Node>
Node
within this object and reusing it when
isReusable()
is true.Modifier and Type | Method and Description |
---|---|
default Cell<T,N> |
afterDispose(Runnable action) |
default Cell<T,N> |
afterReset(Runnable action) |
default Cell<T,N> |
afterUpdateIndex(IntConsumer action) |
default Cell<T,N> |
afterUpdateItem(Consumer<? super T> action) |
default Cell<T,N> |
beforeDispose(Runnable action) |
default Cell<T,N> |
beforeReset(Runnable action) |
default Cell<T,N> |
beforeUpdateIndex(IntConsumer action) |
default Cell<T,N> |
beforeUpdateItem(Consumer<? super T> action) |
default void |
dispose()
Called when this cell is no longer going to be used at all.
|
N |
getNode() |
default boolean |
isReusable()
Indicates whether this cell can be reused to display different items.
|
default void |
reset()
Called when this cell is no longer used to display its item.
|
default void |
updateIndex(int index)
Called to update index of a visible cell.
|
default void |
updateItem(T item)
If this cell is reusable (as indicated by
isReusable() ),
this method is called to display a different item. |
static <T,N extends Node> |
wrapNode(N node) |
N getNode()
default boolean isReusable()
Default implementation returns false
.
default void updateItem(T item)
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
.
item
- the new item to displaydefault void updateIndex(int index)
Default implementation does nothing.
default void reset()
updateItem(Object)
.
Default implementation does nothing.
default void dispose()
reset()
will have been called before this method is invoked.
Default implementation does nothing.
default Cell<T,N> beforeUpdateIndex(IntConsumer action)
default Cell<T,N> afterUpdateIndex(IntConsumer action)