Class GuiVirtualListSnapshot<K,V>
java.lang.Object
com.render.api.gui.GuiVirtualListSnapshot<K,V>
- Type Parameters:
K- stable row keyV- application value
Immutable, ordered keyed data for
VirtualListComponent. Copying, filtering and sorting happen when a new
snapshot is supplied, rather than during a clean rendered frame. Keys and values must themselves be immutable, and
keys must keep stable equality and hash codes. Every row has an explicit positive height in design pixels.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne row's immutable key, value and assigned border-box height. -
Constructor Summary
ConstructorsConstructorDescriptionGuiVirtualListSnapshot(List<GuiVirtualListSnapshot.Entry<K, V>> entries) Copies and validates an ordered row list, rejecting duplicate keys before any component changes. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> GuiVirtualListSnapshot <K, V> empty()Creates an empty snapshot.entries()Filters rows while preserving their keys, heights and relative order.Looks up a stable key without scanning the data.static <K,V> GuiVirtualListSnapshot <K, V> of(List<V> values, Function<? super V, ? extends K> keys, ToDoubleFunction<? super V> heights) Copies application values with explicitly selected keys and row heights.intsize()sorted(Comparator<? super V> comparator) Sorts a copied row list, retaining keyed selection and row identity when installed in a component.
-
Constructor Details
-
GuiVirtualListSnapshot
Copies and validates an ordered row list, rejecting duplicate keys before any component changes.
-
-
Method Details
-
empty
Creates an empty snapshot. -
of
public static <K,V> GuiVirtualListSnapshot<K,V> of(List<V> values, Function<? super V, ? extends K> keys, ToDoubleFunction<? super V> heights) Copies application values with explicitly selected keys and row heights. -
entries
- Returns:
- immutable rows in display order
-
size
public int size()- Returns:
- number of data rows, including rows outside the viewport
-
indexOf
Looks up a stable key without scanning the data. -
filter
Filters rows while preserving their keys, heights and relative order. -
sorted
Sorts a copied row list, retaining keyed selection and row identity when installed in a component.
-