Class TypedArrayList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
enterprises.iwakura.sigewine.utils.collections.TypedArrayList<E>
- Type Parameters:
E- The type of elements in this list.
- All Implemented Interfaces:
TypedCollection<E>,Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,RandomAccess,SequencedCollection<E>
A concrete implementation of
TypedCollection that uses an ArrayList as the underlying data structure.- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionTypedArrayList(Class<E> type) Constructor that initializes the list with the specified type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTypedObject(Object object) Adds an object to the array, ensuring it matches the specified type.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversedMethods inherited from interface enterprises.iwakura.sigewine.utils.collections.TypedCollection
getType
-
Constructor Details
-
TypedArrayList
Constructor that initializes the list with the specified type.- Parameters:
type- The class type of the elements in this list.
-
-
Method Details
-
addTypedObject
Adds an object to the array, ensuring it matches the specified type.- Specified by:
addTypedObjectin interfaceTypedCollection<E>- Parameters:
object- The object to add to the array.- Throws:
IllegalArgumentException- if the object is not of the correct type.
-