public class ImmutableList2<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Modifier and Type | Class and Description |
---|---|
static class |
ImmutableList2.ImmutableList2Iterator<T> |
Modifier and Type | Method and Description |
---|---|
ImmutableList2<T> |
addFirst(T item)
Prepend an item to a list.
|
static <T> ImmutableList2<T> |
empty()
Returns empty list
|
T |
getFirst()
First item
|
ImmutableList2<T> |
getTail()
List without first item
|
boolean |
isEmpty()
Check for emptyness.
|
java.util.Iterator<T> |
iterator() |
ImmutableList2<T> |
remove(T item)
Returns a list with first occurrence of an item removed.
|
ImmutableList2<T> |
reverse()
Reverse a list
|
public boolean isEmpty()
public T getFirst()
public ImmutableList2<T> getTail()
public static <T> ImmutableList2<T> empty()
T
- type of itempublic ImmutableList2<T> addFirst(T item)
item
- item to prependpublic ImmutableList2<T> remove(T item)
item
- item to removepublic ImmutableList2<T> reverse()