com.github.andrewoma.dexx.collection
Interface IndexedList<E>

All Superinterfaces:
Iterable<E>, List<E>, Traversable<E>
All Known Implementing Classes:
AbstractIndexedList, ArrayList, Vector

public interface IndexedList<E>
extends List<E>

IndexedList implementations guarantee fast random access to elements via List.get(int).


Method Summary
 IndexedList<E> append(E elem)
          Returns a list with the specified element appended to the bottom of the list.
 IndexedList<E> drop(int number)
          Returns a list containing all elements in this list, excluding the first number of elements.
 IndexedList<E> prepend(E elem)
          Returns a list with the specified element prepended to the top of the list.
 IndexedList<E> range(int from, boolean fromInclusive, int to, boolean toInclusive)
          Returns a list containing a contiguous range of elements from this list.
 IndexedList<E> set(int i, E elem)
          Returns a list with the element set to the value specified at the index (zero-based).
 IndexedList<E> take(int number)
          Returns a list containing the first number of elements from this list.
 
Methods inherited from interface com.github.andrewoma.dexx.collection.List
asList, first, get, indexOf, last, lastIndexOf, tail
 
Methods inherited from interface com.github.andrewoma.dexx.collection.Iterable
iterator
 
Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable
forEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet
 

Method Detail

set

@NotNull
IndexedList<E> set(int i,
                           E elem)
Description copied from interface: List
Returns a list with the element set to the value specified at the index (zero-based).

Specified by:
set in interface List<E>

append

@NotNull
IndexedList<E> append(E elem)
Description copied from interface: List
Returns a list with the specified element appended to the bottom of the list.

Specified by:
append in interface List<E>

prepend

@NotNull
IndexedList<E> prepend(E elem)
Description copied from interface: List
Returns a list with the specified element prepended to the top of the list.

Specified by:
prepend in interface List<E>

drop

@NotNull
IndexedList<E> drop(int number)
Description copied from interface: List
Returns a list containing all elements in this list, excluding the first number of elements.

Specified by:
drop in interface List<E>

take

@NotNull
IndexedList<E> take(int number)
Description copied from interface: List
Returns a list containing the first number of elements from this list.

Specified by:
take in interface List<E>

range

@NotNull
IndexedList<E> range(int from,
                             boolean fromInclusive,
                             int to,
                             boolean toInclusive)
Description copied from interface: List
Returns a list containing a contiguous range of elements from this list.

Specified by:
range in interface List<E>
Parameters:
from - starting index for the range (zero-based)
fromInclusive - if true, the element at the from index will be included
to - end index for the range (zero-based)
toInclusive - if true, the element at the to index will be included


Copyright © 2014. All Rights Reserved.