Package com.adobe.xfa.ut
Class Storage<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- com.adobe.xfa.ut.Storage<T>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
public class Storage<T> extends ArrayList<T>
A storage utility class which extends java.util.ArrayList with C++-like operations.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
last()
Returns the last element in the storage.void
removeLast()
Removes the last element from the storage.void
setSize(int size)
Sets the size to the given.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
Storage
public Storage()
Creates a storage with initially empty storage.
-
Storage
public Storage(int size)
Creates a storage with a given size. This doesn't actually populate those elements; the size reported will be zero until the elements are populated by the calling application.- Parameters:
size
- initial allocation size.
-
-
Method Detail
-
setSize
public void setSize(int size)
Sets the size to the given. This method may truncate the storage if the new size is smaller or pad the storage with null values if the new size is larger. This method will affect the size reported by the size() method.- Parameters:
size
- new size for the storage.
-
last
public T last()
Returns the last element in the storage.- Returns:
- the last element in the storage; null if the storage is empty.
-
removeLast
public void removeLast()
Removes the last element from the storage.
-
-