Interface TimedStorage<T extends Timed>

Type Parameters:
T - the type of timed element
All Known Implementing Classes:
AnimationKeyframe, TimedStorage.ListDelegate

public interface TimedStorage<T extends Timed>
A read-only storage for timed elements (keyframes), allowing indexed access.

This interface abstracts the underlying data structure (e.g., List, Array) used to store animation frames.

Since:
2.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A TimedStorage implementation that delegates to a List.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Retrieves the element at the specified index.
    Retrieves the last element in the storage.
    static <T extends Timed>
    @NotNull TimedStorage<T>
    listOf(@NotNull List<T> list)
    Creates a TimedStorage backed by a List.
    int
    Returns the number of elements in the storage.
  • Method Details

    • listOf

      @NotNull static <T extends Timed> @NotNull TimedStorage<T> listOf(@NotNull @NotNull List<T> list)
      Creates a TimedStorage backed by a List.
      Type Parameters:
      T - the type of element
      Parameters:
      list - the list of elements
      Returns:
      a new TimedStorage
      Since:
      2.0.0
    • get

      @NotNull T get(int index)
      Retrieves the element at the specified index.
      Parameters:
      index - the index of the element
      Returns:
      the element
      Throws:
      IndexOutOfBoundsException - if the index is out of range
      Since:
      2.0.0
    • size

      int size()
      Returns the number of elements in the storage.
      Returns:
      the size
      Since:
      2.0.0
    • getLast

      @NotNull T getLast()
      Retrieves the last element in the storage.
      Returns:
      the last element
      Throws:
      NoSuchElementException - if the storage is empty
      Since:
      2.0.0