|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<T>
org.jboss.xnio.Sequence<T>
T - the element typepublic final class Sequence<T>

An immutable sequence of elements. Though this class implements List, it is in fact
immutable.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Method Summary | ||
|---|---|---|
|
cast(Class<N> newType)
Cast a sequence to a different type if all the contained elements are of the subtype. |
|
static
|
empty()
Return an empty sequence. |
|
T |
get(int index)
Get the value at a certain index. |
|
boolean |
isEmpty()
Determine whether this sequence is empty. |
|
Iterator<T> |
iterator()
Get an iterator over the elements of this sequence. |
|
static
|
of(Collection<T> members)
Return a sequence of the given members. |
|
static
|
of(T... members)
Return a sequence of the given members. |
|
int |
size()
Return the number of elements in this sequence. |
|
Object[] |
toArray()
Get a copy of the values array. |
|
| Methods inherited from class java.util.AbstractList |
|---|
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray |
| Method Detail |
|---|
public static <T> Sequence<T> of(T... members)
T - the element typemembers - the members
public static <T> Sequence<T> of(Collection<T> members)
T - the element typemembers - the members
public <N> Sequence<N> cast(Class<N> newType)
throws ClassCastException
N - the new typenewType - the class to cast to
ClassCastException - if any elements could not be castpublic static <T> Sequence<T> empty()
T - the element type
public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in interface List<T>iterator in class AbstractList<T>public int size()
size in interface Collection<T>size in interface List<T>size in class AbstractCollection<T>public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface List<T>isEmpty in class AbstractCollection<T>true if the sequence has no elementspublic Object[] toArray()
toArray in interface Collection<T>toArray in interface List<T>toArray in class AbstractCollection<T>public T get(int index)
get in interface List<T>get in class AbstractList<T>index - the index
|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||