E - The type of element managed by the collection.public class List<E> extends SortableCollection<E>
1 2 3 N
[element 1] . [element 2] . [element 3] ... [element N]
-N -(N-1) -(N-2) -1
| Constructor and Description |
|---|
List()
This constructor creates a new empty list.
|
List(Collection<? extends E> elements)
This constructor creates a new list using the elements provided in a collection.
|
List(java.util.Collection<? extends E> elements)
This constructor creates a new list using the elements provided in a java collection.
|
List(E[] elements)
This constructor creates a new list using the elements provided in an array.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addElement(E element)
This method adds a new element to the collection.
|
static <E> List<E> |
concatenation(List<E> list1,
List<E> list2)
This function returns a new list that contains the all the elements from
both the specified lists.
|
List<E> |
copy() |
craterdog.core.Iterator<E> |
createIterator() |
craterdog.core.Manipulator<E> |
createManipulator()
This method creates a new default manipulator for the collection.
|
E |
getElement(int index)
This method returns the element at the specified index.
|
List<E> |
getElements(int firstIndex,
int lastIndex)
This method returns a collection of the elements in the specified index range.
|
int |
getIndex(E element)
This method return the index of the specified element, or zero if the element
is not found.
|
int |
getSize() |
void |
insertElement(E element,
int index)
This method inserts the specified element into the collection before the element
associated with the specified index.
|
void |
insertElements(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.
|
void |
removeAll()
This method removes all elements from the collection.
|
boolean |
removeElement(E element)
This method removes the specified element from the collection.
|
E |
removeElement(int index)
This method removes from the collection the element associated with the specified
index.
|
List<E> |
removeElements(int firstIndex,
int lastIndex)
This method removes from the collection the elements associated with the specified
index range.
|
E |
replaceElement(E element,
int index)
This method replaces an existing element in the collection with a new one.
|
E[] |
toArray() |
concatenate, shuffleElements, sortElements, sortElements, sortElementsaddElements, addElements, removeElements, removeElementscontainsAll, containsAny, containsElement, normalizedIndexcompareTo, equals, hashCodeaddSerializableClass, addSerializableClass, addSerializableClass, createMapper, fromString, fromString, toExposedString, toString, toString, toString, toStringpublic List()
public List(E[] elements)
elements - The elements that should be used to seed the list.public List(Collection<? extends E> elements)
elements - The elements that should be used to seed the list.public List(java.util.Collection<? extends E> elements)
elements - The elements that should be used to seed the list.public E[] toArray()
public final int getSize()
public final E getElement(int index)
CollectiongetElement in class Collection<E>index - The index of the element to be returned.public final int getIndex(E element)
CollectiongetIndex in class Collection<E>element - The element to be checked for in the collection.public final List<E> getElements(int firstIndex, int lastIndex)
CollectiongetElements in class Collection<E>firstIndex - The index of the first element to be returned.lastIndex - the index of the last element to be returned.public final boolean addElement(E element)
OpenCollectionaddElement in class OpenCollection<E>element - The new element to be added.public final void insertElement(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.public final void insertElements(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.public final E replaceElement(E element, int index)
element - The new element that will replace the existing one.index - The index of the existing element.public final E removeElement(int index)
index - The index of the element to be removed.public final boolean removeElement(E element)
OpenCollectionremoveElement in class OpenCollection<E>element - The element to be removed.public final List<E> removeElements(int firstIndex, int lastIndex)
firstIndex - The index of the first element to be removed.lastIndex - The index of the last element to be removed.public final void removeAll()
CollectionremoveAll in class Collection<E>public craterdog.core.Iterator<E> createIterator()
public craterdog.core.Manipulator<E> createManipulator()
SortableCollectioncreateManipulator in class SortableCollection<E>public static <E> List<E> concatenation(List<E> list1, List<E> list2)
E - The type of element contained in the lists.list1 - The first list whose elements are to be added.list2 - The second list whose elements are to be added.Copyright © 2016 Crater Dog Technologies(TM). All rights reserved.