E - The type of element managed by the collection.public interface Indexed<E>
1 2 3 N
[element 1] . [element 2] . [element 3] ... [element N]
-N -(N-1) -(N-2) -1
| Modifier and Type | Method and Description |
|---|---|
E |
getElementAtIndex(int index)
This method returns the element at the specified index.
|
Indexed<E> |
getElementsInRange(int firstIndex,
int lastIndex)
This method returns a collection of the elements in the specified index range.
|
int |
getIndexOfElement(E element)
This method return the index of the specified element, or zero if the element
is not found.
|
void |
insertElementBeforeIndex(E element,
int index)
This method inserts the specified element into the collection before the element
associated with the specified index.
|
void |
insertElementsBeforeIndex(java.lang.Iterable<? extends E> elements,
int index)
This method inserts the specified elements into the collection before the element
associated with the specified index.
|
E |
removeElementAtIndex(int index)
This method removes from the collection the element associated with the specified
index.
|
Indexed<E> |
removeElementsInRange(int firstIndex,
int lastIndex)
This method removes from the collection the elements associated with the specified
index range.
|
E |
replaceElementAtIndex(E element,
int index)
This method replaces an existing element in the collection with a new one.
|
int getIndexOfElement(E element)
element - The element to be checked for in the collection.E getElementAtIndex(int index)
index - The index of the element to be returned.Indexed<E> getElementsInRange(int firstIndex, int lastIndex)
firstIndex - The index of the first element to be returned.lastIndex - the index of the last element to be returned.void insertElementBeforeIndex(E element, int index)
element - The new element to be inserted into the collection.index - The index of the element before which the new element is to be inserted.void insertElementsBeforeIndex(java.lang.Iterable<? extends E> elements, int index)
elements - The new elements to be inserted into the collection.index - The index of the element before which the new element is to be inserted.E replaceElementAtIndex(E element, int index)
element - The new element that will replace the existing one.index - The index of the existing element.E removeElementAtIndex(int index)
index - The index of the element to be removed.Indexed<E> removeElementsInRange(int firstIndex, int lastIndex)
firstIndex - The index of the first element to be removed.lastIndex - The index of the last element to be removed.Copyright © 2015 Crater Dog Technologies(TM). All rights reserved.