E
- the (nominal) type of the list elementspublic class ImmList0<E> extends ImmList<E>
Modifier and Type | Method and Description |
---|---|
ImmList<E> |
append(E member)
Append an element at the end of the list
|
ImmList<E> |
appendList(ImmList<E> members)
Append multiple elements at the end of the list
|
E |
get(int index)
Get the element at a given index
|
ImmList<E> |
insert(int index,
E member)
Insert an element at a given position
|
boolean |
isEmpty()
Ask if the list is empty
|
java.util.Iterator<E> |
iterator() |
ImmList<E> |
remove(int index)
Remove the member at a given position
|
ImmList<E> |
replace(int index,
E member)
Replace the element at a given index
|
int |
size()
Get the size of the list
|
ImmList<E> |
subList(int start,
int end)
Return a sub-sequence with a given start and end position
|
empty, fromList, head, outOfBounds, pair, rebalance, singleton, tail
public int size()
ImmList
public boolean isEmpty()
ImmList
public ImmList<E> replace(int index, E member)
ImmList
public ImmList<E> insert(int index, E member)
ImmList
insert
in class ImmList<E>
index
- the position (zero-based) for the insertion. The new element will
be inserted before the existing element at this position. If the index
is equal to the list size, the new element is inserted at the end.member
- the new member to be included in the new listpublic ImmList<E> append(E member)
ImmList
public ImmList<E> appendList(ImmList<E> members)
ImmList
appendList
in class ImmList<E>
members
- the new members to be included in the new listpublic ImmList<E> remove(int index)
ImmList
public ImmList<E> subList(int start, int end)
ImmList
subList
in class ImmList<E>
start
- the zero-based index position of the first member to be extractedend
- the zero-based index position of the first member after the sub-sequence
to be extractedpublic java.util.Iterator<E> iterator()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.