Interface LongBigList
- All Superinterfaces:
BigList<java.lang.Long>,java.util.Collection<java.lang.Long>,java.lang.Comparable<BigList<? extends java.lang.Long>>,java.lang.Iterable<java.lang.Long>,LongCollection,LongIterable,Size64
- All Known Implementing Classes:
AbstractLongBigList,AbstractLongBigList.LongRandomAccessSubList,AbstractLongBigList.LongSubList,LongBigArrayBigList,LongBigLists.EmptyBigList,LongBigLists.ListBigList,LongBigLists.Singleton,LongBigLists.SynchronizedBigList,LongBigLists.UnmodifiableBigList
public interface LongBigList extends BigList<java.lang.Long>, LongCollection, java.lang.Comparable<BigList<? extends java.lang.Long>>
BigList; provides some additional methods that use
polymorphism to avoid (un)boxing.
Additionally, this interface strengthens iterator(),
listIterator(), listIterator(long) and
subList(long,long).
Besides polymorphic methods, this interfaces specifies methods to copy into an array or remove contiguous sublists. Although the abstract implementation of this interface provides simple, one-by-one implementations of these methods, it is expected that concrete implementation override them with optimized versions.
- See Also:
List
-
Method Summary
Modifier and Type Method Description voidadd(long index, long key)Inserts the specified element at the specified position in this type-specific big list (optional operation).voidadd(long index, java.lang.Long key)Deprecated.Please use the corresponding type-specific method instead.default booleanaddAll(long index, LongBigList l)Inserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).booleanaddAll(long index, LongCollection c)Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).default booleanaddAll(long index, LongList l)Inserts all of the elements in the specified type-specific list into this type-specific big list at the specified position (optional operation).default booleanaddAll(LongBigList l)Appends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).default booleanaddAll(LongList l)Appends all of the elements in the specified type-specific list to the end of this type-specific big list (optional operation).voidaddElements(long index, long[][] a)Add (hopefully quickly) elements to this type-specific big list.voidaddElements(long index, long[][] a, long offset, long length)Add (hopefully quickly) elements to this type-specific big list.java.lang.Longget(long index)Deprecated.Please use the corresponding type-specific method instead.voidgetElements(long from, long[][] a, long offset, long length)Copies (hopefully quickly) elements of this type-specific big list into the given big array.longgetLong(long index)Returns the element at the specified position.longindexOf(long k)Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.longindexOf(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.LongBigListIteratoriterator()Returns a type-specific iterator on the elements of this list.longlastIndexOf(long k)Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.longlastIndexOf(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.LongBigListIteratorlistIterator()Returns a type-specific big-list iterator on this type-specific big list.LongBigListIteratorlistIterator(long index)Returns a type-specific list iterator on this type-specific big list starting at a given index.java.lang.Longremove(long index)Deprecated.Please use the corresponding type-specific method instead.voidremoveElements(long from, long to)Removes (hopefully quickly) elements of this type-specific big list.longremoveLong(long index)Removes the element at the specified position.longset(long index, long k)Replaces the element at the specified position in this big list with the specified element (optional operation).java.lang.Longset(long index, java.lang.Long k)Deprecated.Please use the corresponding type-specific method instead.default voidsetElements(long[][] a)Set (hopefully quickly) elements to match the array given.default voidsetElements(long index, long[][] a)Set (hopefully quickly) elements to match the array given.default voidsetElements(long index, long[][] a, long offset, long length)Set (hopefully quickly) elements to match the array given.default LongSpliteratorspliterator()Returns a type-specific spliterator on the elements of this big-list.LongBigListsubList(long from, long to)Returns a type-specific view of the portion of this type-specific big list from the indexfrom, inclusive, to the indexto, exclusive.Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray, toArrayMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
add, add, addAll, contains, contains, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, rem, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toLongArray, toLongArrayMethods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable
forEach, forEach, forEach
-
Method Details
-
iterator
LongBigListIterator iterator()Returns a type-specific iterator on the elements of this list.- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Long>- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Long>- Specified by:
iteratorin interfaceLongCollection- Specified by:
iteratorin interfaceLongIterable- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Collection.iterator()- API Notes:
- This specification strengthens the one given in
Collection.iterator().
-
listIterator
LongBigListIterator listIterator()Returns a type-specific big-list iterator on this type-specific big list.- Specified by:
listIteratorin interfaceBigList<java.lang.Long>- Returns:
- a big-list iterator over the elements in this big list.
- See Also:
BigList.listIterator()- API Notes:
- This specification strengthens the one given in
BigList.listIterator().
-
listIterator
Returns a type-specific list iterator on this type-specific big list starting at a given index.- Specified by:
listIteratorin interfaceBigList<java.lang.Long>- Parameters:
index- index of first element to be returned from the big-list iterator.- Returns:
- a big-list iterator of the elements in this big list, starting at the specified position in this big list.
- See Also:
BigList.listIterator(long)- API Notes:
- This specification strengthens the one given in
BigList.listIterator(long).
-
spliterator
Returns a type-specific spliterator on the elements of this big-list.BigList spliterators must report at least
Spliterator.SIZEDandSpliterator.ORDERED.See
List.spliterator()for more documentation on the requirements of the returned spliterator (despiteBigListnot being aList, most of the same requirements apply.- Specified by:
spliteratorin interfacejava.util.Collection<java.lang.Long>- Specified by:
spliteratorin interfacejava.lang.Iterable<java.lang.Long>- Specified by:
spliteratorin interfaceLongCollection- Specified by:
spliteratorin interfaceLongIterable- Returns:
- a type-specific spliterator on the elements of this collection.
- Since:
- 8.5.0
- API Notes:
- This is generally the only
spliteratormethod subclasses should override. - Implementation Specification:
- The default implementation returns a late-binding spliterator (see
Spliteratorfor documentation on what binding policies mean).- For
RandomAccesslists, this will return a spliterator that calls the type-specificget(long)method on the appropriate indexes. - Otherwise, the spliterator returned will wrap this instance's
type specific
iterator().
In either case, the spliterator reports
Spliterator.SIZED,Spliterator.SUBSIZED, andSpliterator.ORDERED. - For
- Implementation Notes:
- As the non-RandomAccess case is
based on the iterator, and
Iteratoris an inherently linear API, the returned spliterator will yield limited performance gains when run in parallel contexts, as the returned spliterator'strySplit()will have linear runtime.For
RandomAccesslists, the parallel performance should be reasonable assumingget(long)is truly constant time likeRandomAccesssuggests.
-
subList
Returns a type-specific view of the portion of this type-specific big list from the indexfrom, inclusive, to the indexto, exclusive.- Specified by:
subListin interfaceBigList<java.lang.Long>- Parameters:
from- the starting element (inclusive).to- the ending element (exclusive).- Returns:
- a big sublist view of this big list.
- See Also:
BigList.subList(long,long)- API Notes:
- This specification strengthens the one given in
BigList.subList(long,long).
-
getElements
void getElements(long from, long[][] a, long offset, long length)Copies (hopefully quickly) elements of this type-specific big list into the given big array.- Parameters:
from- the start index (inclusive).a- the destination big array.offset- the offset into the destination big array where to store the first element copied.length- the number of elements to be copied.
-
removeElements
void removeElements(long from, long to)Removes (hopefully quickly) elements of this type-specific big list.- Parameters:
from- the start index (inclusive).to- the end index (exclusive).
-
addElements
void addElements(long index, long[][] a)Add (hopefully quickly) elements to this type-specific big list.- Parameters:
index- the index at which to add elements.a- the big array containing the elements.
-
addElements
void addElements(long index, long[][] a, long offset, long length)Add (hopefully quickly) elements to this type-specific big list.- Parameters:
index- the index at which to add elements.a- the big array containing the elements.offset- the offset of the first element to add.length- the number of elements to add.
-
setElements
default void setElements(long[][] a)Set (hopefully quickly) elements to match the array given.- Parameters:
a- the big array containing the elements.- Since:
- 8.5.0
-
setElements
default void setElements(long index, long[][] a)Set (hopefully quickly) elements to match the array given.- Parameters:
index- the index at which to start setting elements.a- the big array containing the elements.- Since:
- 8.5.0
-
setElements
default void setElements(long index, long[][] a, long offset, long length)Set (hopefully quickly) elements to match the array given. Sets each in this list to the corresponding elements in the array, as if byListIterator iter = listIterator(index); long i = 0; while (i < length) { iter.next(); iter.set(BigArrays.get(a, offset + i++); }However, the exact implementation may be more efficient, taking into account whether random access is faster or not, or at the discretion of subclasses, abuse internals.- Parameters:
index- the index at which to start setting elements.a- the big array containing the elements.offset- the offset of the first element to add.length- the number of elements to add.- Since:
- 8.5.0
-
add
void add(long index, long key)Inserts the specified element at the specified position in this type-specific big list (optional operation).- See Also:
BigList.add(long,Object)
-
addAll
Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).- See Also:
List.addAll(int,java.util.Collection)
-
getLong
long getLong(long index)Returns the element at the specified position.- See Also:
BigList.get(long)
-
removeLong
long removeLong(long index)Removes the element at the specified position.- See Also:
BigList.remove(long)
-
set
long set(long index, long k)Replaces the element at the specified position in this big list with the specified element (optional operation).- See Also:
BigList.set(long,Object)
-
indexOf
long indexOf(long k)Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.- See Also:
BigList.indexOf(Object)
-
lastIndexOf
long lastIndexOf(long k)Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.- See Also:
BigList.lastIndexOf(Object)
-
add
@Deprecated void add(long index, java.lang.Long key)Deprecated.Please use the corresponding type-specific method instead.Inserts the specified element at the specified position in this big list (optional operation). -
get
@Deprecated java.lang.Long get(long index)Deprecated.Please use the corresponding type-specific method instead.Returns the element at the specified position. -
indexOf
@Deprecated long indexOf(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.Returns the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element. -
lastIndexOf
@Deprecated long lastIndexOf(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.Returns the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.- Specified by:
lastIndexOfin interfaceBigList<java.lang.Long>- Parameters:
o- the object to search for.- Returns:
- the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
- See Also:
List.lastIndexOf(Object)
-
remove
@Deprecated java.lang.Long remove(long index)Deprecated.Please use the corresponding type-specific method instead.Removes the element at the specified position. -
set
@Deprecated java.lang.Long set(long index, java.lang.Long k)Deprecated.Please use the corresponding type-specific method instead.Replaces the element at the specified position in this big list with the specified element (optional operation). -
addAll
Inserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).- See Also:
BigList.addAll(long,Collection)- API Notes:
- This method exists only for the sake of efficiency: override are
expected to use
getElements(long, long[][], long, long)/addElements(long, long[][]). - Implementation Specification:
- This method delegates to the one accepting a collection, but it might be implemented more efficiently.
-
addAll
Appends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).- See Also:
Collection.addAll(Collection)- Implementation Specification:
- This method delegates to the index-based version, passing
BigList.size()as first argument.
-
addAll
Inserts all of the elements in the specified type-specific list into this type-specific big list at the specified position (optional operation).- See Also:
BigList.addAll(long,Collection)- API Notes:
- This method exists only for the sake of efficiency: override are
expected to use
getElements(long, long[][], long, long)/addElements(long, long[][]). - Implementation Specification:
- This method delegates to the one accepting a collection, but it might be implemented more efficiently.
-
addAll
Appends all of the elements in the specified type-specific list to the end of this type-specific big list (optional operation).- See Also:
Collection.addAll(Collection)- Implementation Specification:
- This method delegates to the index-based version, passing
BigList.size()as first argument.
-