public static class IntLists.SynchronizedRandomAccessList extends IntLists.SynchronizedList implements java.util.RandomAccess, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected IntCollection |
collection |
protected java.lang.Object |
sync |
list| Modifier | Constructor and Description |
|---|---|
protected |
SynchronizedRandomAccessList(IntList l) |
protected |
SynchronizedRandomAccessList(IntList l,
java.lang.Object sync) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int k)
Ensures that this collection contains the specified element (optional operation).
|
boolean |
add(java.lang.Integer k)
Deprecated.
|
boolean |
addAll(java.util.Collection<? extends java.lang.Integer> c) |
boolean |
addAll(IntCollection c)
Adds all elements of the given type-specific collection to this collection.
|
void |
clear() |
boolean |
contains(int k)
Returns
true if this collection contains the specified element. |
boolean |
contains(java.lang.Object k)
Deprecated.
|
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsAll(IntCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
void |
forEach(java.util.function.IntConsumer action)
Performs the given action for each element of this type-specific
Iterable
until all elements have been processed or the action throws an
exception. |
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator()
Returns a primitive iterator on the elements of this collection.
|
java.util.stream.IntStream |
intParallelStream()
Return a parallel primitive stream over the elements, performing widening casts if needed.
|
it.unimi.dsi.fastutil.ints.IntSpliterator |
intSpliterator()
Returns a primitive spliterator on the elements of this collection.
|
java.util.stream.IntStream |
intStream()
Return a primitive stream over the elements, performing widening casts if needed.
|
boolean |
isEmpty() |
java.util.stream.Stream<java.lang.Integer> |
parallelStream()
Deprecated.
|
boolean |
rem(int k)
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
boolean |
remove(java.lang.Object k)
Deprecated.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(IntCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(IntCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
it.unimi.dsi.fastutil.ints.IntSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this collection.
|
java.util.stream.Stream<java.lang.Integer> |
stream()
Deprecated.
|
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. |
java.lang.Object[] |
toArray() |
int[] |
toArray(int[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
|
<T> T[] |
toArray(T[] a) |
int[] |
toIntArray()
Returns a primitive type array containing the items of this collection.
|
int[] |
toIntArray(int[] a)
Deprecated.
|
java.lang.String |
toString() |
add, add, addAll, addAll, addAll, addAll, addElements, addElements, compareTo, equals, get, getElements, getInt, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, removeElements, removeIf, removeInt, replaceAll, set, set, setElements, setElements, setElements, size, sort, sort, unstableSort, unstableSortclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, contains, of, of, of, of, of, remove, replaceAll, replaceAll, spliteratoraddAll, clear, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArrayaddAll, contains, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, rem, removeAll, removeIf, removeIf, retainAll, stream, toArray, toIntArray, toIntArrayforEach, forEach, forEachprotected final IntCollection collection
protected final java.lang.Object sync
protected SynchronizedRandomAccessList(IntList l, java.lang.Object sync)
protected SynchronizedRandomAccessList(IntList l)
public IntList subList(int from, int to)
IntListfrom, inclusive, to the index to, exclusive.subList in interface IntListsubList in interface java.util.List<java.lang.Integer>subList in class IntLists.SynchronizedListList.subList(int,int)public boolean add(int k)
IntCollectionadd in interface IntCollectionCollection.add(Object)public boolean contains(int k)
IntCollectiontrue if this collection contains the specified element.contains in interface IntCollectionCollection.contains(Object)public boolean rem(int k)
IntCollectionNote that this method should be called remove(), but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates
remove().
rem in interface IntCollectionCollection.remove(Object)public int size()
size in interface java.util.Collection<java.lang.Integer>public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.Integer>public int[] toIntArray()
IntCollectiontoIntArray in interface IntCollectionCollection.toArray()public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Integer>@Deprecated public int[] toIntArray(int[] a)
IntCollectionNote that, contrarily to Collection.toArray(Object[]), this
methods just writes all elements of this collection: no special
value will be added after the last one.
toIntArray in interface IntCollectiona - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public int[] toArray(int[] a)
IntCollectionNote that, contrarily to Collection.toArray(Object[]), this
methods just writes all elements of this collection: no special
value will be added after the last one.
toArray in interface IntCollectiona - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public boolean addAll(IntCollection c)
IntCollectionaddAll in interface IntCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean containsAll(IntCollection c)
IntCollectioncontainsAll in interface IntCollectionc - a type-specific collection.true if this collection contains all elements of the argument.Collection.containsAll(Collection)public boolean removeAll(IntCollection c)
IntCollectionremoveAll in interface IntCollectionc - 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 IntCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.retainAll(Collection)@Deprecated public boolean add(java.lang.Integer k)
IntCollectionadd in interface IntCollectionadd in interface java.util.Collection<java.lang.Integer>@Deprecated public boolean contains(java.lang.Object k)
IntCollectioncontains in interface IntCollectioncontains in interface java.util.Collection<java.lang.Integer>@Deprecated public boolean remove(java.lang.Object k)
IntCollectionremove in interface IntCollectionremove in interface java.util.Collection<java.lang.Integer>public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
IntCollection
This method is identical to IntCollection.iterator(), as the type-specific
iterator is already compatible with the JDK's primitive iterators.
It only exists for compatibility with the other primitive types' Collections
that have use for widened iterators.
intIterator in interface IntCollectionintIterator in interface IntIterablepublic it.unimi.dsi.fastutil.ints.IntSpliterator intSpliterator()
IntCollection
This method is identical to IntCollection.spliterator(), as the type-specific
spliterator is already compatible with the JDK's primitive spliterators.
It only exists for compatibility with the other primitive types' Collections
that have use for widened spliterators.
intSpliterator in interface IntCollectionintSpliterator in interface IntIterablepublic java.util.stream.IntStream intStream()
IntCollectionintStream in interface IntCollectionCollection.stream(),
IntStreampublic java.util.stream.IntStream intParallelStream()
IntCollectionintParallelStream in interface IntCollectionCollection.parallelStream(),
IntStreampublic <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<java.lang.Integer>public it.unimi.dsi.fastutil.ints.IntSpliterator spliterator()
IntCollectionSee Collection.spliterator() for more documentation on the requirements
of the returned spliterator.
spliterator in interface IntCollectionspliterator in interface IntIterablespliterator in interface java.lang.Iterable<java.lang.Integer>spliterator in interface java.util.Collection<java.lang.Integer>@Deprecated public java.util.stream.Stream<java.lang.Integer> stream()
IntCollectionstream in interface IntCollectionstream in interface java.util.Collection<java.lang.Integer>@Deprecated public java.util.stream.Stream<java.lang.Integer> parallelStream()
IntCollectionparallelStream in interface IntCollectionparallelStream in interface java.util.Collection<java.lang.Integer>public void forEach(java.util.function.IntConsumer action)
IntIterableIterable
until all elements have been processed or the action throws an
exception.forEach in interface IntIterableaction - the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)public boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
addAll in interface java.util.Collection<java.lang.Integer>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<java.lang.Integer>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Integer>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Integer>public void clear()
clear in interface java.util.Collection<java.lang.Integer>public java.lang.String toString()
toString in class java.lang.Object