- All Implemented Interfaces:
StringList
,Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,List<String>
,RandomAccess
,SequencedCollection<String>
,DOMStringList
Implementation of
StringList
based on ArrayList
.- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionConstructs an empty list with aArrayList
's default initial capacity.ArrayStringList
(int initialCapacity) Constructs an empty list with the specified initial capacity.ArrayStringList
(Collection<? extends String> c) Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. -
Method Summary
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, 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, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
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
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
ArrayStringList
public ArrayStringList()Constructs an empty list with aArrayList
's default initial capacity. -
ArrayStringList
public ArrayStringList(int initialCapacity) Constructs an empty list with the specified initial capacity.- Parameters:
initialCapacity
- the initial capacity of the list.- Throws:
IllegalArgumentException
- if the specified initial capacity is negative.
-
ArrayStringList
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.- Parameters:
c
- the collection whose elements are to be placed into this list.- Throws:
NullPointerException
- if the specified collection is null.
-
-
Method Details
-
item
- Specified by:
item
in interfaceDOMStringList
-
getLength
public int getLength()- Specified by:
getLength
in interfaceDOMStringList
-
contains
- Specified by:
contains
in interfaceDOMStringList
-
clone
Description copied from interface:StringList
Returns a shallow copy of thisStringList
instance. (The elements themselves are not copied.)- Specified by:
clone
in interfaceStringList
- Overrides:
clone
in classArrayList<String>
- Returns:
- a clone of this
StringList
.
-