E - type of elements stored in the listpublic abstract class IList<E>
extends java.util.AbstractList<E>
implements java.util.List<E>, java.util.RandomAccess, java.lang.Cloneable, java.io.Serializable, java.util.Deque<E>
Note that this implementation is not synchronized.
List,
ArrayList,
LinkedList,
Serialized Form| Constructor and Description |
|---|
IList() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E elem)
Appends the specified element to the end of this list (optional
operation).
|
void |
add(int index,
E elem)
Inserts the specified element at the specified position in this list
(optional operation).
|
boolean |
addAll(java.util.Collection<? extends E> coll)
Adds all of the elements in the specified collection into this list.
|
boolean |
addAll(E... elems)
Adds all specified elements into this list.
|
boolean |
addAll(IList<? extends E> list)
Adds all of the elements in the specified list into this list.
|
boolean |
addAll(int index,
java.util.Collection<? extends E> coll)
Inserts all of the elements in the specified collection into this
list, starting at the specified position.
|
boolean |
addAll(int index,
E... elems)
Inserts the specified elements into this list,
starting at the specified position.
|
boolean |
addAll(int index,
IList<? extends E> list)
Inserts all of the elements in the specified list into this
list, starting at the specified position.
|
void |
addFirst(E elem)
Inserts the specified element at the front of this deque if it is
possible to do so immediately without violating capacity restrictions.
|
boolean |
addIfAbsent(E elem)
Add elements if it is not already contained in the list.
|
void |
addLast(E elem)
Inserts the specified element at the end of this deque if it is
possible to do so immediately without violating capacity restrictions.
|
abstract <K> int |
binarySearch(int index,
int len,
K key,
java.util.Comparator<? super K> comparator)
Searches the specified range for an object using the binary
search algorithm.
|
<K> int |
binarySearch(K key,
java.util.Comparator<? super K> comparator)
Searches the specified range for an object using the binary
search algorithm.
|
abstract int |
capacity()
Returns capacity of this GapList.
|
void |
clear()
Removes all of the elements from this list (optional operation).
|
java.lang.Object |
clone()
Returns a shallow copy of this GapList instance
(The elements themselves are not copied).
|
boolean |
contains(java.lang.Object elem)
Returns true if this collection contains the specified element.
|
boolean |
containsAll(java.util.Collection<?> coll)
Returns true if this collection contains all of the elements
in the specified collection.
|
boolean |
containsAny(java.util.Collection<?> coll)
Returns true if any of the elements of the specified collection is contained in the list.
|
IList<E> |
copy()
Returns a shallow copy of this GapList instance
(the new list will contain the same elements as the source list, i.e. the elements themselves are not copied).
|
static <E> void |
copy(IList<? extends E> src,
int srcIndex,
IList<E> dst,
int dstIndex,
int len)
Copies elements from one GapList to another.
|
void |
copy(int srcIndex,
int dstIndex,
int len)
Copy specified elements.
|
java.util.Iterator<E> |
descendingIterator()
Returns an iterator over the elements in this deque in reverse
sequential order.
|
void |
drag(int srcIndex,
int dstIndex,
int len)
Drag specified elements.
|
E |
element()
Retrieves, but does not remove, the head of the queue represented by
this deque (in other words, the first element of this deque).
|
void |
ensureCapacity(int minCapacity)
Increases the capacity of this GapList instance, if
necessary, to ensure that it can hold at least the number of elements
specified by the minimum capacity argument.
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this list for equality.
|
void |
fill(E elem)
Fill list.
|
void |
fill(int index,
int len,
E elem)
Fill specified elements.
|
void |
filter(Predicate<? super E> predicate)
Filter the list using the specified predicate.
|
E |
get(int index)
Returns the element at the specified position in this list.
|
IList<E> |
getAll(E elem)
Returns all elements in the list equal to the specified element.
|
IList<E> |
getAll(int index,
int len)
Returns specified range of elements from list.
|
E[] |
getArray(int index,
int len)
Returns specified range of elements from list.
|
int |
getCount(E elem)
Counts how many times the specified element is contained in the list.
|
java.util.Set<E> |
getDistinct()
Returns distinct elements in the list.
|
E |
getFirst()
Retrieves, but does not remove, the first element of this deque.
|
E |
getLast()
Retrieves, but does not remove, the last element of this deque.
|
int |
hashCode()
Returns the hash code value for this list.
|
int |
indexOf(java.lang.Object elem)
Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
|
void |
init(int len,
E elem)
Initializes the list so it will afterwards have a size of
len and contain only the element elem. |
boolean |
isEmpty()
Returns true if this collection contains no elements.
|
java.util.Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
int |
lastIndexOf(java.lang.Object elem)
Returns the index of the last occurrence of the specified element
in this list, or -1 if this list does not contain the element.
|
java.util.ListIterator<E> |
listIterator()
Returns a list iterator over the elements in this list (in proper
sequence).
|
java.util.ListIterator<E> |
listIterator(int index)
Returns a list iterator of the elements in this list (in proper
sequence), starting at the specified position in this list.
|
<R> IList<R> |
mappedList(Mapper<E,R> mapper)
Create a new list by applying the specified mapper to all elements.
|
static <E> void |
move(IList<E> src,
int srcIndex,
IList<? super E> dst,
int dstIndex,
int len)
Moves elements from one GapList to another.
|
void |
move(int srcIndex,
int dstIndex,
int len)
Move specified elements.
|
boolean |
offer(E elem)
Inserts the specified element into the queue represented by this deque
(in other words, at the tail of this deque) if it is possible to do so
immediately without violating capacity restrictions, returning
true upon success and false if no space is currently
available.
|
boolean |
offerFirst(E elem)
Inserts the specified element at the front of this deque unless it would
violate capacity restrictions.
|
boolean |
offerLast(E elem)
Inserts the specified element at the end of this deque unless it would
violate capacity restrictions.
|
E |
peek()
Retrieves, but does not remove, the head of the queue represented by
this deque (in other words, the first element of this deque), or
returns null if this deque is empty.
|
E |
peekFirst()
Retrieves, but does not remove, the first element of this deque,
or returns null if this deque is empty.
|
E |
peekLast()
Retrieves, but does not remove, the last element of this deque,
or returns null if this deque is empty.
|
E |
poll()
Retrieves and removes the head of the queue represented by this deque
(in other words, the first element of this deque), or returns
null if this deque is empty.
|
E |
pollFirst()
Retrieves and removes the first element of this deque,
or returns null if this deque is empty.
|
E |
pollLast()
Retrieves and removes the last element of this deque,
or returns null if this deque is empty.
|
E |
pop()
Pops an element from the stack represented by this deque.
|
void |
push(E elem)
Pushes an element onto the stack represented by this deque (in other
words, at the head of this deque) if it is possible to do so
immediately without violating capacity restrictions, returning
true upon success and throwing an
IllegalStateException if no space is currently available.
|
E |
remove()
Retrieves and removes the head of the queue represented by this deque
(in other words, the first element of this deque).
|
E |
remove(int index)
Removes the element at the specified position in this list (optional
operation).
|
void |
remove(int index,
int len)
Remove specified range of elements from list.
|
boolean |
remove(java.lang.Object elem)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
boolean |
removeAll(java.util.Collection<?> coll)
Removes all of this collection's elements that are also contained in the
specified collection (optional operation).
|
IList<E> |
removeAll(E elem)
Removes all equal elements.
|
boolean |
removeAll(IList<?> coll) |
E |
removeFirst()
Retrieves and removes the first element of this deque.
|
boolean |
removeFirstOccurrence(java.lang.Object elem)
Removes the first occurrence of the specified element from this deque.
|
E |
removeLast()
Retrieves and removes the last element of this deque.
|
boolean |
removeLastOccurrence(java.lang.Object elem)
Removes the last occurrence of the specified element from this deque.
|
void |
resize(int len,
E elem)
Resizes the list so it will afterwards have a size of
len. |
boolean |
retainAll(java.util.Collection<?> coll)
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
|
boolean |
retainAll(IList<?> coll) |
void |
reverse()
Reverses the order of all elements in the specified list.
|
void |
reverse(int index,
int len)
Reverses the order of the specified elements in the list.
|
void |
rotate(int distance)
Rotate specified elements in the list.
|
void |
rotate(int index,
int len,
int distance)
Rotate specified elements in the list.
|
E |
set(int index,
E elem)
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
void |
setAll(int index,
java.util.Collection<? extends E> coll)
Replaces the specified elements.
|
void |
setAll(int index,
E... elems)
Replaces the specified elements.
|
void |
setAll(int index,
IList<? extends E> list)
Replaces the specified elements.
|
abstract int |
size()
Returns the number of elements in this collection.
|
void |
sort(java.util.Comparator<? super E> comparator)
Sort elements in the list using the specified comparator.
|
abstract void |
sort(int index,
int len,
java.util.Comparator<? super E> comparator)
Sort specified elements in the list using the specified comparator.
|
static <E> void |
swap(IList<E> src,
int srcIndex,
IList<E> dst,
int dstIndex,
int len)
Swaps elements from two GapLists.
|
void |
swap(int index1,
int index2,
int len)
Swap the specified elements in the list.
|
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this collection.
|
java.lang.Object[] |
toArray(int index,
int len)
Returns an array containing the specified elements in this list.
|
<T> T[] |
toArray(T[] array)
Returns an array containing all of the elements in this collection;
the runtime type of the returned array is that of the specified array.
|
java.lang.String |
toString()
Returns a string representation of this collection.
|
abstract void |
trimToSize()
Trims the capacity of this GapList instance to be the
list's current size.
|
abstract IList<E> |
unmodifiableList()
Returns an unmodifiable view of this list.
|
public IList<E> copy()
clone()public abstract IList<E> unmodifiableList()
public java.lang.Object clone()
clone in class java.lang.ObjectCloneablepublic void clear()
java.util.AbstractListThis implementation calls removeRange(0, size()).
Note that this implementation throws an
UnsupportedOperationException unless remove(int
index) or removeRange(int fromIndex, int toIndex) is
overridden.
public abstract int size()
java.util.Collectionpublic abstract int capacity()
public E get(int index)
java.util.AbstractListpublic E set(int index, E elem)
java.util.AbstractListThis implementation always throws an
UnsupportedOperationException.
public boolean add(E elem)
java.util.AbstractListLists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
This implementation calls add(size(), e).
Note that this implementation throws an
UnsupportedOperationException unless
add(int, E) is overridden.
add in interface java.util.Collection<E>add in interface java.util.Deque<E>add in interface java.util.List<E>add in interface java.util.Queue<E>add in class java.util.AbstractList<E>elem - element to be appended to this listtrue (as specified by Collection.add(E))public void add(int index,
E elem)
java.util.AbstractListThis implementation always throws an
UnsupportedOperationException.
public E remove(int index)
java.util.AbstractListThis implementation always throws an
UnsupportedOperationException.
public void ensureCapacity(int minCapacity)
minCapacity - the desired minimum capacitypublic abstract void trimToSize()
public boolean equals(java.lang.Object obj)
java.util.AbstractListtrue if and only if the specified object is also a list, both
lists have the same size, and all corresponding pairs of elements in
the two lists are equal. (Two elements e1 and
e2 are equal if (e1==null ? e2==null :
e1.equals(e2)).) In other words, two lists are defined to be
equal if they contain the same elements in the same order.
This implementation first checks if the specified object is this
list. If so, it returns true; if not, it checks if the
specified object is a list. If not, it returns false; if so,
it iterates over both lists, comparing corresponding pairs of elements.
If any comparison returns false, this method returns
false. If either iterator runs out of elements before the
other it returns false (as the lists are of unequal length);
otherwise it returns true when the iterations complete.
equals in interface java.util.Collection<E>equals in interface java.util.List<E>equals in class java.util.AbstractList<E>obj - the object to be compared for equality with this listtrue if the specified object is equal to this listObject.hashCode(),
Hashtablepublic int hashCode()
java.util.AbstractListThis implementation uses exactly the code that is used to define the
list hash function in the documentation for the List.hashCode()
method.
public java.lang.String toString()
java.util.AbstractCollectionString.valueOf(Object).toString in class java.util.AbstractCollection<E>public boolean isEmpty()
java.util.AbstractCollectionThis implementation returns size() == 0.
public int getCount(E elem)
elem - element to countpublic IList<E> getAll(E elem)
elem - element to look forpublic java.util.Set<E> getDistinct()
public <R> IList<R> mappedList(Mapper<E,R> mapper)
mapper - mapper functionpublic void filter(Predicate<? super E> predicate)
predicate - predicate used for filteringpublic int indexOf(java.lang.Object elem)
java.util.AbstractListThis implementation first gets a list iterator (with
listIterator()). Then, it iterates over the list until the
specified element is found or the end of the list is reached.
public int lastIndexOf(java.lang.Object elem)
java.util.AbstractListThis implementation first gets a list iterator that points to the end
of the list (with listIterator(size())). Then, it iterates
backwards over the list until the specified element is found, or the
beginning of the list is reached.
public boolean remove(java.lang.Object elem)
java.util.AbstractCollectionThis implementation iterates over the collection looking for the specified element. If it finds the element, it removes the element from the collection using the iterator's remove method.
Note that this implementation throws an UnsupportedOperationException if the iterator returned by this collection's iterator method does not implement the remove method and this collection contains the specified object.
remove in interface java.util.Collection<E>remove in interface java.util.Deque<E>remove in interface java.util.List<E>remove in class java.util.AbstractCollection<E>elem - element to be removed from this collection, if presentpublic boolean contains(java.lang.Object elem)
java.util.AbstractCollectionThis implementation iterates over the elements in the collection, checking each element in turn for equality with the specified element.
contains in interface java.util.Collection<E>contains in interface java.util.Deque<E>contains in interface java.util.List<E>contains in class java.util.AbstractCollection<E>elem - element whose presence in this collection is to be testedpublic boolean addIfAbsent(E elem)
elem - element to addpublic boolean containsAny(java.util.Collection<?> coll)
coll - collection with elements to be containedpublic boolean containsAll(java.util.Collection<?> coll)
java.util.AbstractCollectionThis implementation iterates over the specified collection, checking each element returned by the iterator in turn to see if it's contained in this collection. If all elements are so contained true is returned, otherwise false.
containsAll in interface java.util.Collection<E>containsAll in interface java.util.List<E>containsAll in class java.util.AbstractCollection<E>coll - collection to be checked for containment in this collectionAbstractCollection.contains(Object)public boolean removeAll(java.util.Collection<?> coll)
java.util.AbstractCollectionThis implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements in common with the specified collection.
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>removeAll in class java.util.AbstractCollection<E>coll - collection containing elements to be removed from this collectionAbstractCollection.remove(Object),
AbstractCollection.contains(Object)public IList<E> removeAll(E elem)
elem - elementpublic boolean removeAll(IList<?> coll)
removeAll(Collection)public boolean retainAll(java.util.Collection<?> coll)
java.util.AbstractCollectionThis implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's not so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements not present in the specified collection.
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>retainAll in class java.util.AbstractCollection<E>coll - collection containing elements to be retained in this collectionAbstractCollection.remove(Object),
AbstractCollection.contains(Object)public boolean retainAll(IList<?> coll)
retainAll(Collection)public java.lang.Object[] toArray()
java.util.AbstractCollectionThe returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
This implementation returns an array containing all the elements
returned by this collection's iterator, in the same order, stored in
consecutive elements of the array, starting with index 0.
The length of the returned array is equal to the number of elements
returned by the iterator, even if the size of this collection changes
during iteration, as might happen if the collection permits
concurrent modification during iteration. The size method is
called only as an optimization hint; the correct result is returned
even if the iterator returns a different number of elements.
This method is equivalent to:
List<E> list = new ArrayList<E>(size());
for (E e : this)
list.add(e);
return list.toArray();
public java.lang.Object[] toArray(int index,
int len)
index - index of first element to copylen - number of elements to copypublic <T> T[] toArray(T[] array)
java.util.AbstractCollectionIf this collection fits in the specified array with room to spare (i.e., the array has more elements than this collection), the element in the array immediately following the end of the collection is set to null. (This is useful in determining the length of this collection only if the caller knows that this collection does not contain any null elements.)
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
Like the Collection.toArray() method, this method acts as bridge between
array-based and collection-based APIs. Further, this method allows
precise control over the runtime type of the output array, and may,
under certain circumstances, be used to save allocation costs.
Suppose x is a collection known to contain only strings. The following code can be used to dump the collection into a newly allocated array of String:
String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to
toArray().
This implementation returns an array containing all the elements
returned by this collection's iterator in the same order, stored in
consecutive elements of the array, starting with index 0.
If the number of elements returned by the iterator is too large to
fit into the specified array, then the elements are returned in a
newly allocated array with length equal to the number of elements
returned by the iterator, even if the size of this collection
changes during iteration, as might happen if the collection permits
concurrent modification during iteration. The size method is
called only as an optimization hint; the correct result is returned
even if the iterator returns a different number of elements.
This method is equivalent to:
List<E> list = new ArrayList<E>(size());
for (E e : this)
list.add(e);
return list.toArray(a);
toArray in interface java.util.Collection<E>toArray in interface java.util.List<E>toArray in class java.util.AbstractCollection<E>array - the array into which the elements of this collection are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose.public boolean addAll(java.util.Collection<? extends E> coll)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>addAll in class java.util.AbstractCollection<E>coll - collection containing elements to be added to this listjava.lang.NullPointerException - if the specified collection is nullAbstractCollection.add(Object)public boolean addAll(int index,
java.util.Collection<? extends E> coll)
addAll in interface java.util.List<E>addAll in class java.util.AbstractList<E>index - index at which to insert the first element from the
specified collectioncoll - collection containing elements to be inserted into this listjava.lang.IndexOutOfBoundsException - if the index is invalidjava.lang.NullPointerException - if the specified collection is nullpublic boolean addAll(E... elems)
elems - elements to be added to this listpublic boolean addAll(int index,
E... elems)
index - index at which to insert the first element from the
specified collectionelems - elements to be inserted into this listjava.lang.IndexOutOfBoundsException - if the index is invalidpublic boolean addAll(IList<? extends E> list)
list - collection containing elements to be added to this listjava.lang.NullPointerException - if the specified list is nullpublic boolean addAll(int index,
IList<? extends E> list)
index - index at which to insert the first element from the
specified collectionlist - list containing elements to be inserted into this listjava.lang.IndexOutOfBoundsException - if the index is invalidjava.lang.NullPointerException - if the specified collection is nullpublic java.util.Iterator<E> iterator()
java.util.AbstractListThis implementation returns a straightforward implementation of the
iterator interface, relying on the backing list's size(),
get(int), and remove(int) methods.
Note that the iterator returned by this method will throw an
UnsupportedOperationException in response to its
remove method unless the list's remove(int) method is
overridden.
This implementation can be made to throw runtime exceptions in the
face of concurrent modification, as described in the specification
for the (protected) modCount field.
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.Deque<E>iterator in interface java.util.List<E>iterator in class java.util.AbstractList<E>AbstractList.modCountpublic java.util.ListIterator<E> listIterator()
java.util.AbstractListThis implementation returns listIterator(0).
public java.util.ListIterator<E> listIterator(int index)
java.util.AbstractListnext.
An initial call to previous would
return the element with the specified index minus one.
This implementation returns a straightforward implementation of the
ListIterator interface that extends the implementation of the
Iterator interface returned by the iterator() method.
The ListIterator implementation relies on the backing list's
get(int), set(int, E), add(int, E)
and remove(int) methods.
Note that the list iterator returned by this implementation will
throw an UnsupportedOperationException in response to its
remove, set and add methods unless the
list's remove(int), set(int, E), and
add(int, E) methods are overridden.
This implementation can be made to throw runtime exceptions in the
face of concurrent modification, as described in the specification for
the (protected) modCount field.
listIterator in interface java.util.List<E>listIterator in class java.util.AbstractList<E>index - index of first element to be returned from the
list iterator (by a call to the next method)AbstractList.modCountpublic java.util.Iterator<E> descendingIterator()
java.util.DequedescendingIterator in interface java.util.Deque<E>public E peek()
java.util.DequeThis method is equivalent to Deque.peekFirst().
public E element()
java.util.Dequepeek only in that it throws an
exception if this deque is empty.
This method is equivalent to Deque.getFirst().
public E poll()
java.util.DequeThis method is equivalent to Deque.pollFirst().
public E remove()
java.util.Dequepoll only in that it throws an
exception if this deque is empty.
This method is equivalent to Deque.removeFirst().
public boolean offer(E elem)
java.util.DequeDeque.add(E) method, which can fail to
insert an element only by throwing an exception.
This method is equivalent to Deque.offerLast(E).
public E getFirst()
java.util.DequepeekFirst only in that it
throws an exception if this deque is empty.getFirst in interface java.util.Deque<E>public E getLast()
java.util.DequepeekLast only in that it
throws an exception if this deque is empty.getLast in interface java.util.Deque<E>public void addFirst(E elem)
java.util.DequeDeque.offerFirst(E).addFirst in interface java.util.Deque<E>elem - the element to addpublic void addLast(E elem)
java.util.DequeDeque.offerLast(E).
This method is equivalent to Deque.add(E).
addLast in interface java.util.Deque<E>elem - the element to addpublic E removeFirst()
java.util.DequepollFirst only in that it throws an
exception if this deque is empty.removeFirst in interface java.util.Deque<E>public E removeLast()
java.util.DequepollLast only in that it throws an
exception if this deque is empty.removeLast in interface java.util.Deque<E>public boolean offerFirst(E elem)
java.util.DequeDeque.addFirst(E) method,
which can fail to insert an element only by throwing an exception.offerFirst in interface java.util.Deque<E>elem - the element to addpublic boolean offerLast(E elem)
java.util.DequeDeque.addLast(E) method,
which can fail to insert an element only by throwing an exception.offerLast in interface java.util.Deque<E>elem - the element to addpublic E peekFirst()
java.util.DequepeekFirst in interface java.util.Deque<E>public E peekLast()
java.util.DequepeekLast in interface java.util.Deque<E>public E pollFirst()
java.util.DequepollFirst in interface java.util.Deque<E>public E pollLast()
java.util.DequepollLast in interface java.util.Deque<E>public E pop()
java.util.DequeThis method is equivalent to Deque.removeFirst().
pop in interface java.util.Deque<E>public void push(E elem)
java.util.DequeThis method is equivalent to Deque.addFirst(E).
push in interface java.util.Deque<E>elem - the element to pushpublic boolean removeFirstOccurrence(java.lang.Object elem)
java.util.DequeremoveFirstOccurrence in interface java.util.Deque<E>elem - element to be removed from this deque, if presentpublic boolean removeLastOccurrence(java.lang.Object elem)
java.util.DequeremoveLastOccurrence in interface java.util.Deque<E>elem - element to be removed from this deque, if presentpublic static <E> void move(IList<E> src, int srcIndex, IList<? super E> dst, int dstIndex, int len)
E - type of elements stored in the listsrc - source listsrcIndex - index of first element in source listdst - destination listdstIndex - index of first element in source listlen - number of elements to movejava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic static <E> void copy(IList<? extends E> src, int srcIndex, IList<E> dst, int dstIndex, int len)
E - type of elements stored in the listsrc - source listsrcIndex - index of first element in source listdst - destination listdstIndex - index of first element in source listlen - number of elements to copyjava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic static <E> void swap(IList<E> src, int srcIndex, IList<E> dst, int dstIndex, int len)
E - type of elements stored in the listsrc - first listsrcIndex - index of first element in first listdst - second listdstIndex - index of first element in second listlen - number of elements to swapjava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic IList<E> getAll(int index, int len)
index - index of first element to retrievelen - number of elements to retrievepublic E[] getArray(int index, int len)
index - index of first element to retrievelen - number of elements to retrievepublic void setAll(int index,
IList<? extends E> list)
index - index of first element to setlist - list with elements to setjava.lang.IndexOutOfBoundsException - if the range is invalidpublic void setAll(int index,
java.util.Collection<? extends E> coll)
index - index of first element to setcoll - collection with elements to setpublic void setAll(int index,
E... elems)
index - index of first element to setelems - elements to setjava.lang.IndexOutOfBoundsException - if the range is invalidpublic void remove(int index,
int len)
index - index of first element to removelen - number of elements to removejava.lang.IndexOutOfBoundsException - if the range is invalidpublic void init(int len,
E elem)
len and contain only the element elem.
The list will grow or shrink as needed.len - length of listelem - element which the list will containjava.lang.IndexOutOfBoundsException - if the range is invalidpublic void resize(int len,
E elem)
len. If the list must grow, the specified
element elem will be used for filling.len - length of listelem - element which will be used for extending the listjava.lang.IndexOutOfBoundsException - if the range is invalidpublic void fill(E elem)
elem - element used for fillingpublic void fill(int index,
int len,
E elem)
index - index of first element to filllen - number of elements to fillelem - element used for fillingjava.lang.IndexOutOfBoundsException - if the range is invalidpublic void copy(int srcIndex,
int dstIndex,
int len)
srcIndex - index of first source element to copydstIndex - index of first destination element to copylen - number of elements to copyjava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic void move(int srcIndex,
int dstIndex,
int len)
srcIndex - index of first source element to movedstIndex - index of first destination element to movelen - number of elements to movejava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic void drag(int srcIndex,
int dstIndex,
int len)
srcIndex - index of first source element to movedstIndex - index of first destination element to movelen - number of elements to movejava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic void reverse()
public void reverse(int index,
int len)
index - index of first element to reverselen - number of elements to reversejava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic void swap(int index1,
int index2,
int len)
index1 - index of first element in first range to swapindex2 - index of first element in second range to swaplen - number of elements to swapjava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic void rotate(int distance)
distance - distance to move the elementspublic void rotate(int index,
int len,
int distance)
index - index of first element to rotatelen - number of elements to rotatedistance - distance to move the elementsjava.lang.IndexOutOfBoundsException - if the ranges are invalidpublic void sort(java.util.Comparator<? super E> comparator)
comparator - comparator to use for sorting
(null means the elements natural ordering should be used)Arrays.sort(long[])public abstract void sort(int index,
int len,
java.util.Comparator<? super E> comparator)
index - index of first element to sortlen - number of elements to sortcomparator - comparator to use for sorting
(null means the elements natural ordering should be used)java.lang.IndexOutOfBoundsException - if the range is invalidArrays.sort(long[])public <K> int binarySearch(K key,
java.util.Comparator<? super K> comparator)
key - the value to be searched forcomparator - the comparator by which the list is ordered.
A null value indicates that the elements'
natural ordering should be used.Arrays.binarySearch(long[], long)public abstract <K> int binarySearch(int index,
int len,
K key,
java.util.Comparator<? super K> comparator)
index - index of first element to searchlen - number of elements to searchkey - the value to be searched forcomparator - the comparator by which the list is ordered.
A null value indicates that the elements'
natural ordering should be used.java.lang.IndexOutOfBoundsException - if the range is invalidArrays.binarySearch(long[], long)