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 ClassesModifier and TypeInterfaceDescriptionstatic final recordTimedStorage.ListDelegate<T extends Timed>ATimedStorageimplementation that delegates to aList. -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Retrieves the element at the specified index.getLast()Retrieves the last element in the storage.static <T extends Timed>
@NotNull TimedStorage<T> Creates a TimedStorage backed by a List.intsize()Returns the number of elements in the storage.
-
Method Details
-
listOf
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
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
Retrieves the last element in the storage.- Returns:
- the last element
- Throws:
NoSuchElementException- if the storage is empty- Since:
- 2.0.0
-