IntCollection, IntIterable, IntList, IntStack, Stack<java.lang.Integer>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.List<? extends java.lang.Integer>>, java.lang.Iterable<java.lang.Integer>, java.util.Collection<java.lang.Integer>, java.util.List<java.lang.Integer>, java.util.RandomAccesspublic static class IntLists.Singleton extends AbstractIntList implements java.util.RandomAccess, java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
AbstractIntList.IntSubList| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addAll(int i,
IntCollection c) |
Inserts all of the elements in the specified type-specific collection into
this type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
IntList c) |
Inserts all of the elements in the specified type-specific list into this
type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Integer> c) |
Adds all of the elements in the specified collection to this list (optional
operation).
|
boolean |
addAll(IntCollection c) |
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(IntList c) |
Appends all of the elements in the specified type-specific list to the end of
this type-specific list (optional operation).
|
boolean |
addAll(java.util.Collection<? extends java.lang.Integer> c) |
|
void |
clear() |
|
java.lang.Object |
clone() |
|
boolean |
contains(int k) |
Returns true if this list contains the specified element.
|
int |
getInt(int i) |
Returns the element at the specified position in this list.
|
IntListIterator |
iterator() |
Returns a type-specific iterator on the elements of this collection.
|
IntListIterator |
listIterator() |
Returns a type-specific list iterator on the list.
|
IntListIterator |
listIterator(int i) |
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(int k) |
Removes a single instance of the specified element from this collection, if
it is present (optional operation).
|
boolean |
removeAll(IntCollection c) |
Remove from this collection all elements in the given type-specific
collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
|
int |
removeInt(int i) |
Removes the element at the specified position in this list (optional
operation).
|
boolean |
retainAll(IntCollection c) |
Retains in this collection only elements from the given type-specific
collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
|
int |
size() |
|
void |
size(int size) |
Sets the size of this list.
|
IntList |
subList(int from,
int to) |
Returns a type-specific view of the portion of this list from the index
from, inclusive, to the index to, exclusive. |
int[] |
toIntArray() |
Returns a primitive type array containing the items of this collection.
|
add, contains, containsAll, remove, toArray, toIntArrayadd, add, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, lastIndexOf, peekInt, popInt, push, removeElements, set, topInt, toStringcontainsAll, removeIf, removeIf, toArray, toIntArrayforEach, forEachadd, add, contains, get, indexOf, lastIndexOf, remove, remove, setpublic int getInt(int i)
IntListpublic boolean rem(int k)
AbstractIntList
This implementation delegates to indexOf().
rem in interface IntCollectionrem in class AbstractIntListList.remove(Object)public int removeInt(int i)
AbstractIntList
This implementation always throws an UnsupportedOperationException.
removeInt in interface IntListremoveInt in class AbstractIntListList.remove(int)public boolean contains(int k)
AbstractIntList
This implementation delegates to indexOf().
contains in interface IntCollectioncontains in class AbstractIntListList.contains(Object)public int[] toIntArray()
IntCollectiontoIntArray in interface IntCollectiontoIntArray in class AbstractIntCollectionCollection.toArray()public IntListIterator listIterator()
AbstractIntList
This implementation delegates to listIterator(0).
listIterator in interface IntListlistIterator in interface java.util.List<java.lang.Integer>listIterator in class AbstractIntListList.listIterator()public IntListIterator iterator()
AbstractIntList
Note that this specification strengthens the one given in
Iterable.iterator(), which was already strengthened in the
corresponding type-specific class, but was weakened by the fact that this
interface extends Collection.
This implementation delegates to AbstractIntList.listIterator().
iterator in interface java.util.Collection<java.lang.Integer>iterator in interface IntCollectioniterator in interface IntIterableiterator in interface IntListiterator in interface java.lang.Iterable<java.lang.Integer>iterator in interface java.util.List<java.lang.Integer>iterator in class AbstractIntListIterable.iterator()public IntListIterator listIterator(int i)
AbstractIntListThis implementation is based on the random-access methods.
listIterator in interface IntListlistIterator in interface java.util.List<java.lang.Integer>listIterator in class AbstractIntListList.listIterator(int)public IntList subList(int from, int to)
IntListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in
List.subList(int,int).
subList in interface IntListsubList in interface java.util.List<java.lang.Integer>subList in class AbstractIntListList.subList(int,int)public boolean addAll(int i,
java.util.Collection<? extends java.lang.Integer> c)
AbstractIntListaddAll in interface java.util.List<java.lang.Integer>addAll in class AbstractIntListpublic boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
AbstractIntList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface java.util.Collection<java.lang.Integer>addAll in interface java.util.List<java.lang.Integer>addAll in class AbstractIntListpublic boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Integer>removeAll in interface java.util.List<java.lang.Integer>removeAll in class java.util.AbstractCollection<java.lang.Integer>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Integer>retainAll in interface java.util.List<java.lang.Integer>retainAll in class java.util.AbstractCollection<java.lang.Integer>public boolean addAll(IntList c)
AbstractIntList
This implementation delegates to the type-specific list version of
List.addAll(int, Collection).
addAll in interface IntListaddAll in class AbstractIntListList.add(int,Object)public boolean addAll(int i,
IntList c)
AbstractIntList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface IntListaddAll in class AbstractIntListList.add(int,Object)public boolean addAll(int i,
IntCollection c)
IntListaddAll in interface IntListaddAll in class AbstractIntListList.addAll(int,java.util.Collection)public boolean addAll(IntCollection c)
AbstractIntList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface IntCollectionaddAll in class AbstractIntListc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean removeAll(IntCollection c)
IntCollectionremoveAll in interface IntCollectionremoveAll in class AbstractIntCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.removeAll(Collection)public boolean retainAll(IntCollection c)
IntCollectionretainAll in interface IntCollectionretainAll in class AbstractIntCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.retainAll(Collection)public int size()
size in interface java.util.Collection<java.lang.Integer>size in interface java.util.List<java.lang.Integer>size in class java.util.AbstractCollection<java.lang.Integer>public void size(int size)
IntList
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
size in interface IntListsize in class AbstractIntListsize - the new size.public void clear()
AbstractIntList
This implementation delegates to AbstractIntList.removeElements(int, int).
clear in interface java.util.Collection<java.lang.Integer>clear in interface java.util.List<java.lang.Integer>clear in class AbstractIntListpublic java.lang.Object clone()