E
- the type of abstract objects stored in this listpublic class AbstractObjectList<E extends AbstractObject> extends java.util.ArrayList<E> implements java.io.Serializable, ObjectProvider<E>
GenericObjectIterator
through iterator
method.Constructor and Description |
---|
AbstractObjectList()
Constructs an empty AbstractObject list with an initial capacity of ten.
|
AbstractObjectList(java.util.Collection<? extends E> source)
Constructs an AbstractObject list containing the elements of the specified
collection, in the order they are returned by the collection's
iterator.
|
AbstractObjectList(int capacity)
Constructs an empty AbstractObject list with the specified initial capacity.
|
AbstractObjectList(java.util.Iterator<? extends E> iterator)
Constructs an AbstractObject list containing all
elements returned by the specified iterator (in that order).
|
AbstractObjectList(java.util.Iterator<? extends E> iterator,
int count)
Constructs an AbstractObject list containing maximally
count
elements returned by the specified iterator (in that order). |
Modifier and Type | Method and Description |
---|---|
int |
addAll(java.util.Iterator<? extends E> iterator)
Appends all of the elements that can be retrieved from the specified
iterator to the end of this list.
|
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.
|
int |
dataHashCode()
Returns a hash code value for the data of this list.
|
AbstractObjectIterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
AbstractObjectIterator<E> |
provideObjects()
The iterator for provided objects for ObjectProvider interface.
|
static <F extends AbstractObject> |
randomList(int count,
boolean unique,
java.util.Iterator<F> iterSource)
Returns a list containing randomly choosen objects from the passed iterator.
|
static <F extends AbstractObject> |
randomList(int count,
boolean unique,
java.util.Iterator<F> iterSource,
int sizeOfSource)
Selector of random data from an iterator source with known number of objects in the iterator.
|
<T extends java.util.List<E>> |
randomList(int count,
boolean unique,
T list)
Returns a list containing randomly choosen objects from this list.
|
static <F extends AbstractObject,T extends java.util.List<F>> |
randomList(int count,
boolean unique,
T list,
java.util.Iterator<F> iterSource)
Returns a list containing randomly choosen objects from the passed iterator.
|
static <F extends AbstractObject,T extends java.util.List<F>> |
randomList(int count,
boolean unique,
T list,
java.util.Iterator<F> iterSource,
int sizeOfSource)
Selector of random data from an iterator source with known number of objects in the iterator.
|
E |
randomObject()
Returns one object selected from the list at random.
|
java.lang.String |
toString()
Returns a string representation of this collection of objects.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
public AbstractObjectList(int capacity) throws java.lang.IllegalArgumentException
capacity
- the initial capacity of the listjava.lang.IllegalArgumentException
- if the specified initial capacity is negativepublic AbstractObjectList()
public AbstractObjectList(java.util.Collection<? extends E> source) throws java.lang.NullPointerException
source
- the collection whose elements are to be placed into this listjava.lang.NullPointerException
- if the specified collection is nullpublic AbstractObjectList(java.util.Iterator<? extends E> iterator, int count) throws java.lang.NullPointerException
count
elements returned by the specified iterator (in that order).iterator
- the iterator returing elements that are to be placed into this listcount
- maximal number of objects that are placed from iterator
(negative number means unlimited)java.lang.NullPointerException
- if the specified iterator is nullpublic AbstractObjectList(java.util.Iterator<? extends E> iterator) throws java.lang.NullPointerException
iterator
- the iterator returing elements that are to be placed into this listjava.lang.NullPointerException
- if the specified iterator is nullpublic AbstractObjectIterator<E> iterator()
iterator
in interface java.lang.Iterable<E extends AbstractObject>
iterator
in interface java.util.Collection<E extends AbstractObject>
iterator
in interface java.util.List<E extends AbstractObject>
iterator
in class java.util.ArrayList<E extends AbstractObject>
public AbstractObjectIterator<E> provideObjects()
provideObjects
in interface ObjectProvider<E extends AbstractObject>
public int addAll(java.util.Iterator<? extends E> iterator)
iterator
- iterator over elements to be added to this listpublic boolean dataEquals(java.lang.Object obj)
obj
- the reference object with which to compare.true
if this object has the same data as the obj
argument; false
otherwise.public int dataHashCode()
public java.lang.String toString()
toString
in class java.util.AbstractCollection<E extends AbstractObject>
public E randomObject()
public <T extends java.util.List<E>> T randomList(int count, boolean unique, T list)
T
- the list class that receives random objectscount
- Number of object to return.unique
- Flag if returned list contains each object only once.list
- An instance of a class extending ObjectListpublic static <F extends AbstractObject,T extends java.util.List<F>> T randomList(int count, boolean unique, T list, java.util.Iterator<F> iterSource)
F
- the class of objects that are stored in the listT
- the list class that receives random objectscount
- Number of object to return.unique
- Flag if returned list contains each object only once.list
- An instance of a class extending ObjectListiterSource
- Iterator from which objects are randomly picked.public static <F extends AbstractObject,T extends java.util.List<F>> T randomList(int count, boolean unique, T list, java.util.Iterator<F> iterSource, int sizeOfSource)
F
- the class of objects that are stored in the listT
- the list class that receives random objectscount
- Number of object to return.unique
- Flag if returned list contains each object only once.list
- An instance of a class extending ObjectListiterSource
- Iterator from which objects are randomly picked.sizeOfSource
- number of objects in the iteratorpublic static <F extends AbstractObject> AbstractObjectList<F> randomList(int count, boolean unique, java.util.Iterator<F> iterSource)
F
- the class of objects that are stored in the listcount
- Number of object to return.unique
- Flag if returned list contains each object only once.iterSource
- Iterator from which objects are randomly picked.public static <F extends AbstractObject> AbstractObjectList<F> randomList(int count, boolean unique, java.util.Iterator<F> iterSource, int sizeOfSource)
F
- the class of objects that are stored in the listcount
- Number of object to return.unique
- Flag if returned list contains each object only once.iterSource
- Iterator from which objects are randomly picked.sizeOfSource
- number of objects in the iterator