Package snap.util
Class ObjectArray<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
snap.util.ObjectArray<T>
- All Implemented Interfaces:
Cloneable
,Iterable<T>
,Collection<T>
,List<T>
This class manages an array of object values.
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionObjectArray
(Class<T> aClass) Constructor.ObjectArray
(Class<T> aClass, int length) Constructor.ObjectArray
(T[] anArray) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the value at index.void
clear()
Clears the list.protected ObjectArray<T>
clone()
Standard clone implementation.get
(int anIndex) Returns the Object value at index.T[]
getArray()
Returns the simple array (trimmed to length).Returns the component class.getLast()
Returns the last item.boolean
isEmpty()
Returns whether array is empty.remove
(int anIndex) Removes the item at index.Sets the String value at index.void
setLength
(int aValue) Sets the length.final int
size()
Returns the length.toString()
Standard toString implementation.Standard toStringProps implementation.Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
_array
-
_size
protected int _size
-
-
Constructor Details
-
ObjectArray
Constructor. -
ObjectArray
Constructor. -
ObjectArray
Constructor.
-
-
Method Details
-
size
public final int size()Returns the length.- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
setLength
public void setLength(int aValue) Sets the length. -
get
Returns the Object value at index. -
set
Sets the String value at index. -
add
Adds the value at index. -
remove
Removes the item at index. -
isEmpty
public boolean isEmpty()Returns whether array is empty.- Specified by:
isEmpty
in interfaceCollection<T>
- Specified by:
isEmpty
in interfaceList<T>
- Overrides:
isEmpty
in classAbstractCollection<T>
-
getArray
Returns the simple array (trimmed to length). -
getLast
Returns the last item. -
getComponentClass
Returns the component class. -
clear
public void clear()Clears the list.- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceList<T>
- Overrides:
clear
in classAbstractList<T>
-
clone
Standard clone implementation. -
toString
Standard toString implementation.- Overrides:
toString
in classAbstractCollection<T>
-
toStringProps
Standard toStringProps implementation.
-