T - the type of the elements in the listpublic abstract class ImmutableList<T>
extends java.lang.Object
implements java.lang.Iterable<T>
ImmList, it is optimized for sequential access rather than
direct access.| Constructor and Description |
|---|
ImmutableList() |
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableList<T> |
empty()
Return an empty list
|
boolean |
equals(java.lang.Object o)
Test whether two lists are equal
|
abstract T |
head()
Get the first item in the list
|
abstract boolean |
isEmpty()
Ask whether the list is empty
|
java.util.Iterator<T> |
iterator()
Get an iterator over the elements of the list
|
ImmutableList<T> |
prepend(T element)
Return a list with a new item added at the start
|
int |
size()
Get the size of the list (the number of items).
|
abstract ImmutableList<T> |
tail()
Get all items in the list other than the first
|
java.lang.String |
toString()
Return a string representation of the list contents
|
public abstract T head()
public abstract ImmutableList<T> tail()
public abstract boolean isEmpty()
public final int size()
public ImmutableList<T> prepend(T element)
element - the item to be added at the startpublic static <T> ImmutableList<T> empty()
T - the nominal item type of the list elementspublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the other listpublic java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.