E
- the type of content of this Listpublic interface ImmutableList<E> extends ImmutableCollection<E>
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Force to redefine equals for the implementations of immutable collection classes.
|
E |
get(int index)
Returns the element at the specified position in this immutable list.
|
int |
hashCode()
Force to redefine hashCode for the implementations of immutable collection classes.
|
int |
indexOf(Object o)
Returns the index of the first occurrence of the specified element in this immutable list, or -1 if this immutable list
does not contain the element.
|
int |
lastIndexOf(Object o)
Returns the index of the last occurrence of the specified element in this immutable list, or -1 if this immutable list
does not contain the element.
|
ImmutableList<E> |
subList(int fromIndex,
int toIndex)
Returns a safe, immutable copy of the portion of this immutable list between the specified fromIndex, inclusive,
and toIndex, exclusive.
|
List<E> |
toList()
Returns a modifiable copy of this immutable list.
|
contains, containsAll, containsAll, isCopy, isEmpty, isWrap, iterator, parallelStream, size, spliterator, stream, toArray, toArray, toCollection
E get(int index)
index
- index of the element to returnIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())int indexOf(Object o)
o
- element to search forClassCastException
- if the type of the specified element is incompatible with this immutable listNullPointerException
- if the specified element is null and this immutable list does not permit null elementsint lastIndexOf(Object o)
o
- element to search forClassCastException
- if the type of the specified element is incompatible with this immutable listNullPointerException
- if the specified element is null and this immutable list does not permit null elementsImmutableList<E> subList(int fromIndex, int toIndex)
fromIndex
- low endpoint (inclusive) of the subListtoIndex
- high endpoint (exclusive) of the subListIndexOutOfBoundsException
- for an illegal endpoint index value (fromIndex < 0 || toIndex > size ||
fromIndex > toIndex)List<E> toList()
boolean equals(Object obj)
equals
in interface ImmutableCollection<E>
equals
in class Object
obj
- the object to compare this collection withint hashCode()
hashCode
in interface ImmutableCollection<E>
hashCode
in class Object
Copyright © 2014–2016 Delft University of Technology. All rights reserved.