Memory<GenericType>
An alternative array-backed storage container. Copies and shrinks the internal array on mutation to manage small, dynamic data segments.
Constructors
JAVA
Memory<GenericType> memory = new Memory<>();
Methods
void add(GenericType obj)
Appends the element by resizing and copying the underlying storage array.
boolean contains(GenericType obj)
Checks for element equality using the object's equals() logic.
void remove(GenericType obj)
Finds and removes the first matching occurrence of the object, then shrinks the backing array.
void removeAt(int index)
Removes the item at the specified index, shifting all trailing elements to the left.
GenericType get(int index) / int count() / void clear()
Standard accessors and clearing routines to handle storage operations.