public final class ArrayImageList extends Object
ArrayImage
Constructor and Description |
---|
ArrayImageList()
Creates an empty list
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Img element)
Appends the specified element to the end of this list
|
void |
add(int index,
Img element)
Inserts the specified element at the specified position in this list.
Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). |
boolean |
addAll(Collection<? extends Img> collection)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator
|
void |
addAll(Img... values)
Loads an array of elements in the the list
|
boolean |
addAll(int index,
Collection<? extends E> collection) |
protected boolean |
checkRange(int index)
Checks if the index is in the right range.
|
void |
clear()
Removes all of the elements from this list.
|
boolean |
contains(Object object)
Returns true if this list contains the specified element.
|
boolean |
containsAll(Collection<?> collection)
Returns true if this list contains all of the elements of the specified collection.
|
Img |
get(int index)
Returns the element at the specified position in this list.
|
int |
indexOf(Object object)
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
|
boolean |
isEmpty()
Returns true if this list contains no elements
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
int |
lastIndexOf(Object object)
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
|
ListIterator<E> |
listIterator()
Returns a list iterator over the elements in this list
|
ListIterator<E> |
listIterator(int index)
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one. |
Img |
remove(int index)
Removes the element at the specified position in this list.
Shifts any subsequent elements to the left (subtracts one from their indices). |
boolean |
remove(Object object)
Removes the first occurrence of the specified element from this list, if it is present.
|
boolean |
removeAll(Collection<?> collection)
Removes from this list all of its elements that are contained in the specified collection.
|
boolean |
retainAll(Collection<?> collection)
Retains only the elements in this list that are contained in the specified collection.
In other words, removes from this list all of its elements that are not contained in the specified collection. |
Img |
set(int index,
Img element)
Replaces the element at the specified position in this list with the specified element.
|
int |
size()
Returns the number of elements in this list.
|
List<E> |
subList(int fromIndex,
int toIndex)
Not implemented
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public void addAll(Img... values)
values
- an array of elements to be loadedpublic boolean add(Img element)
public boolean addAll(Collection<? extends Img> collection)
public boolean retainAll(Collection<?> collection)
public void clear()
public Img get(int index)
public Img set(int index, Img element)
public void add(int index, Img element)
public Img remove(int index)
public int indexOf(Object object)
public int lastIndexOf(Object object)
public Object[] toArray()
public int size()
size
in interface Collection<E>
size
in interface List<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface List<E>
public boolean contains(Object object)
contains
in interface Collection<E>
contains
in interface List<E>
public Iterator<E> iterator()
public <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
toArray
in interface List<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public final boolean addAll(int index, Collection<? extends E> collection)
public final boolean remove(Object object)
remove
in interface Collection<E>
remove
in interface List<E>
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
public final boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<E>
removeAll
in interface List<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
public List<E> subList(int fromIndex, int toIndex)
protected final boolean checkRange(int index)
index
- index to be checkedtrue
if the index is in the right range otherwise false