oracle.javatools.util
Class ImmutableList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
oracle.javatools.util.ImmutableList<E>
- All Implemented Interfaces:
- java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>
public class ImmutableList<E>
- extends java.util.AbstractList<E>
An immutable list which wraps an array without copying.
Fields inherited from class java.util.AbstractList |
modCount |
Methods inherited from class java.util.AbstractList |
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
Methods inherited from class java.util.AbstractCollection |
toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ImmutableList
public ImmutableList(E element)
ImmutableList
public ImmutableList(E... elements)
size
public int size()
- Specified by:
size
in interface java.util.Collection<E>
- Specified by:
size
in interface java.util.List<E>
- Specified by:
size
in class java.util.AbstractCollection<E>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Collection<E>
- Specified by:
isEmpty
in interface java.util.List<E>
- Overrides:
isEmpty
in class java.util.AbstractCollection<E>
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interface java.util.Collection<E>
- Specified by:
contains
in interface java.util.List<E>
- Overrides:
contains
in class java.util.AbstractCollection<E>
containsAll
public boolean containsAll(java.util.Collection<?> collection)
- Specified by:
containsAll
in interface java.util.Collection<E>
- Specified by:
containsAll
in interface java.util.List<E>
- Overrides:
containsAll
in class java.util.AbstractCollection<E>
get
public E get(int index)
- Specified by:
get
in interface java.util.List<E>
- Specified by:
get
in class java.util.AbstractList<E>
iterator
public java.util.Iterator<E> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<E>
- Specified by:
iterator
in interface java.util.Collection<E>
- Specified by:
iterator
in interface java.util.List<E>
- Overrides:
iterator
in class java.util.AbstractList<E>
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interface java.util.Collection<E>
- Specified by:
toArray
in interface java.util.List<E>
- Overrides:
toArray
in class java.util.AbstractCollection<E>
toArray
public <T> T[] toArray(T[] array)
- Specified by:
toArray
in interface java.util.Collection<E>
- Specified by:
toArray
in interface java.util.List<E>
- Overrides:
toArray
in class java.util.AbstractCollection<E>
add
public boolean add(java.lang.Object o)
- Specified by:
add
in interface java.util.Collection<E>
- Specified by:
add
in interface java.util.List<E>
- Overrides:
add
in class java.util.AbstractList<E>
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interface java.util.Collection<E>
- Specified by:
remove
in interface java.util.List<E>
- Overrides:
remove
in class java.util.AbstractCollection<E>
addAll
public boolean addAll(java.util.Collection c)
- Specified by:
addAll
in interface java.util.Collection<E>
- Specified by:
addAll
in interface java.util.List<E>
- Overrides:
addAll
in class java.util.AbstractCollection<E>
removeAll
public boolean removeAll(java.util.Collection c)
- Specified by:
removeAll
in interface java.util.Collection<E>
- Specified by:
removeAll
in interface java.util.List<E>
- Overrides:
removeAll
in class java.util.AbstractCollection<E>
retainAll
public boolean retainAll(java.util.Collection c)
- Specified by:
retainAll
in interface java.util.Collection<E>
- Specified by:
retainAll
in interface java.util.List<E>
- Overrides:
retainAll
in class java.util.AbstractCollection<E>
clear
public void clear()
- Specified by:
clear
in interface java.util.Collection<E>
- Specified by:
clear
in interface java.util.List<E>
- Overrides:
clear
in class java.util.AbstractList<E>
Copyright © 1997, 2013, Oracle. All rights reserved.