Class AbstractBooleanBigList
- All Implemented Interfaces:
it.unimi.dsi.fastutil.BigList<Boolean>,BooleanBigList,it.unimi.dsi.fastutil.booleans.BooleanCollection,it.unimi.dsi.fastutil.booleans.BooleanIterable,it.unimi.dsi.fastutil.booleans.BooleanStack,it.unimi.dsi.fastutil.Size64,it.unimi.dsi.fastutil.Stack<Boolean>,Comparable<it.unimi.dsi.fastutil.BigList<? extends Boolean>>,Iterable<Boolean>,Collection<Boolean>
- Direct Known Subclasses:
AbstractBooleanBigList.BooleanSubList,BooleanBigArrayBigList,BooleanBigLists.ListBigList,BooleanBigLists.Singleton
Most of the methods in this class are optimized with the assumption that the List will have
have constant-time random access. If this is not the case, you
should probably at least override listIterator(long) and the xAll() methods
(such as addAll(long, java.util.Collection<? extends java.lang.Boolean>)) with a more appropriate iteration scheme. Note the subList(long, long)
method is cognizant of random-access or not, so that need not be reimplemented.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classA class implementing a sublist view. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(boolean k) voidadd(long index, boolean k) Inserts the specified element at the specified position in this type-specific big list (optional operation).voidDeprecated.Please use the corresponding type-specific method instead.booleanaddAll(long index, it.unimi.dsi.fastutil.booleans.BooleanCollection c) Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).booleanaddAll(long index, Collection<? extends Boolean> c) Adds all of the elements in the specified collection to this list (optional operation).booleanaddAll(it.unimi.dsi.fastutil.booleans.BooleanCollection c) booleanaddAll(Collection<? extends Boolean> c) voidaddElements(long index, boolean[][] a) Add (hopefully quickly) elements to this type-specific big list.voidaddElements(long index, boolean[][] a, long offset, long length) Add (hopefully quickly) elements to this type-specific big list.voidclear()intCompares this big list to another object.booleancontains(boolean k) Returns true if this list contains the specified element.protected voidensureIndex(long index) Ensures that the given index is nonnegative and not greater than this big-list size.protected voidensureRestrictedIndex(long index) Ensures that the given index is nonnegative and smaller than this big-list size.booleanvoidforEach(it.unimi.dsi.fastutil.booleans.BooleanConsumer action) get(long index) Deprecated.Please use the corresponding type-specific method instead.voidgetElements(long from, boolean[][] a, long offset, long length) Copies (hopefully quickly) elements of this type-specific big list into the given big array.inthashCode()Returns the hash code for this big list, which is identical toList.hashCode().longindexOf(boolean 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.longDeprecated.Please use the corresponding type-specific method instead.it.unimi.dsi.fastutil.booleans.BooleanBigListIteratoriterator()Returns a type-specific iterator on the elements of this list.longlastIndexOf(boolean 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(Object ok) Deprecated.Please use the corresponding type-specific method instead.it.unimi.dsi.fastutil.booleans.BooleanBigListIteratorReturns a type-specific big-list iterator on this type-specific big list.it.unimi.dsi.fastutil.booleans.BooleanBigListIteratorlistIterator(long index) Returns a type-specific list iterator on this type-specific big list starting at a given index.peek(int i) Deprecated.Please use the corresponding type-specific method instead.booleanpeekBoolean(int i) pop()Deprecated.Please use the corresponding type-specific method instead.booleanvoidpush(boolean o) voidDeprecated.Please use the corresponding type-specific method instead.booleanrem(boolean k) Removes a single instance of the specified element from this collection, if it is present (optional operation).remove(long index) Deprecated.Please use the corresponding type-specific method instead.booleanremoveBoolean(long i) Removes the element at the specified position.voidremoveElements(long from, long to) Removes (hopefully quickly) elements of this type-specific big list.booleanset(long index, boolean k) Replaces the element at the specified position in this big list with the specified element (optional operation).Deprecated.Please use the corresponding type-specific method instead.voidsetElements(long index, boolean[][] a, long offset, long length) Set (hopefully quickly) elements to match the array given.intsize()Deprecated.Please useSize64.size64()instead.voidsize(long size) subList(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.top()Deprecated.Please use the corresponding type-specific method instead.booleantoString()Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
add, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toArray, toBooleanArray, toBooleanArrayMethods inherited from class java.util.AbstractCollection
isEmpty, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanBigList
addAll, addAll, addAll, addAll, getBoolean, getElements, setElements, setElements, spliteratorMethods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection
add, contains, containsAll, remove, removeAll, removeIf, removeIf, retainAll, toArray, toBooleanArray, toBooleanArrayMethods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanIterable
forEachMethods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, removeAll, retainAll, stream, toArray, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.Size64
size64Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
-
Constructor Details
-
AbstractBooleanBigList
protected AbstractBooleanBigList()
-
-
Method Details
-
ensureIndex
protected void ensureIndex(long index) Ensures that the given index is nonnegative and not greater than this big-list size.- Parameters:
index- an index.- Throws:
IndexOutOfBoundsException- if the given index is negative or greater than this big-list size.
-
ensureRestrictedIndex
protected void ensureRestrictedIndex(long index) Ensures that the given index is nonnegative and smaller than this big-list size.- Parameters:
index- an index.- Throws:
IndexOutOfBoundsException- if the given index is negative or not smaller than this big-list size.
-
add
public void add(long index, boolean k) Inserts the specified element at the specified position in this type-specific big list (optional operation).- Specified by:
addin interfaceBooleanBigList- See Also:
-
add
public boolean add(boolean k) - Specified by:
addin interfaceit.unimi.dsi.fastutil.booleans.BooleanCollection- Overrides:
addin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
-
removeBoolean
public boolean removeBoolean(long i) Removes the element at the specified position.- Specified by:
removeBooleanin interfaceBooleanBigList- See Also:
-
set
public boolean set(long index, boolean k) Replaces the element at the specified position in this big list with the specified element (optional operation).- Specified by:
setin interfaceBooleanBigList- See Also:
-
addAll
Adds all of the elements in the specified collection to this list (optional operation).- Specified by:
addAllin interfaceit.unimi.dsi.fastutil.BigList<Boolean>
-
addAll
- Specified by:
addAllin interfaceCollection<Boolean>- Overrides:
addAllin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
-
iterator
public it.unimi.dsi.fastutil.booleans.BooleanBigListIterator iterator()Returns a type-specific iterator on the elements of this list.- Specified by:
iteratorin interfaceBooleanBigList- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.booleans.BooleanCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.booleans.BooleanIterable- Specified by:
iteratorin interfaceCollection<Boolean>- Specified by:
iteratorin interfaceIterable<Boolean>- Specified by:
iteratorin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection- See Also:
-
listIterator
public it.unimi.dsi.fastutil.booleans.BooleanBigListIterator listIterator()Returns a type-specific big-list iterator on this type-specific big list.- Specified by:
listIteratorin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
listIteratorin interfaceBooleanBigList- See Also:
-
listIterator
public it.unimi.dsi.fastutil.booleans.BooleanBigListIterator listIterator(long index) Returns a type-specific list iterator on this type-specific big list starting at a given index.- Specified by:
listIteratorin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
listIteratorin interfaceBooleanBigList- See Also:
-
contains
public boolean contains(boolean k) Returns true if this list contains the specified element.- Specified by:
containsin interfaceit.unimi.dsi.fastutil.booleans.BooleanCollection- Overrides:
containsin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection- See Also:
-
indexOf
public long indexOf(boolean k) Description copied from interface:BooleanBigListReturns 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.- Specified by:
indexOfin interfaceBooleanBigList- See Also:
-
lastIndexOf
public long lastIndexOf(boolean k) Description copied from interface:BooleanBigListReturns 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.- Specified by:
lastIndexOfin interfaceBooleanBigList- See Also:
-
size
public void size(long size) - Specified by:
sizein interfaceit.unimi.dsi.fastutil.BigList<Boolean>
-
subList
Description copied from interface:BooleanBigListReturns a type-specific view of the portion of this type-specific big list from the indexfrom, inclusive, to the indexto, exclusive.- Specified by:
subListin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
subListin interfaceBooleanBigList- See Also:
-
forEach
public void forEach(it.unimi.dsi.fastutil.booleans.BooleanConsumer action) - Specified by:
forEachin interfaceit.unimi.dsi.fastutil.booleans.BooleanIterable
-
removeElements
public void removeElements(long from, long to) Removes (hopefully quickly) elements of this type-specific big list.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
removeElementsin interfaceBooleanBigList- Parameters:
from- the start index (inclusive).to- the end index (exclusive).
-
addElements
public void addElements(long index, boolean[][] a, long offset, long length) Add (hopefully quickly) elements to this type-specific big list.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
addElementsin interfaceBooleanBigList- 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.
-
addElements
public void addElements(long index, boolean[][] a) Add (hopefully quickly) elements to this type-specific big list.- Specified by:
addElementsin interfaceBooleanBigList- Parameters:
index- the index at which to add elements.a- the big array containing the elements.
-
getElements
public void getElements(long from, boolean[][] a, long offset, long length) Copies (hopefully quickly) elements of this type-specific big list into the given big array.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
getElementsin interfaceBooleanBigList- 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.
-
setElements
public void setElements(long index, boolean[][] a, long offset, long length) Description copied from interface:BooleanBigListSet (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.- Specified by:
setElementsin interfaceBooleanBigList- 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.
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Boolean>- Overrides:
clearin classAbstractCollection<Boolean>
-
size
Deprecated.Please useSize64.size64()instead.- Specified by:
sizein interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
sizein interfaceCollection<Boolean>- Specified by:
sizein interfaceit.unimi.dsi.fastutil.Size64- Specified by:
sizein classAbstractCollection<Boolean>
-
hashCode
public int hashCode()Returns the hash code for this big list, which is identical toList.hashCode().- Specified by:
hashCodein interfaceCollection<Boolean>- Overrides:
hashCodein classObject- Returns:
- the hash code for this big list.
-
equals
- Specified by:
equalsin interfaceCollection<Boolean>- Overrides:
equalsin classObject
-
compareTo
Compares this big list to another object. If the argument is aBigList, this method performs a lexicographical comparison; otherwise, it throws aClassCastException.- Specified by:
compareToin interfaceComparable<it.unimi.dsi.fastutil.BigList<? extends Boolean>>- Parameters:
l- a big list.- Returns:
- if the argument is a
BigList, a negative integer, zero, or a positive integer as this list is lexicographically less than, equal to, or greater than the argument. - Throws:
ClassCastException- if the argument is not a big list.
-
push
public void push(boolean o) - Specified by:
pushin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack
-
popBoolean
public boolean popBoolean()- Specified by:
popBooleanin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack
-
topBoolean
public boolean topBoolean()- Specified by:
topBooleanin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack
-
peekBoolean
public boolean peekBoolean(int i) - Specified by:
peekBooleanin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack
-
rem
public boolean rem(boolean k) Removes a single instance of the specified element from this collection, if it is present (optional operation).- Specified by:
remin interfaceit.unimi.dsi.fastutil.booleans.BooleanCollection- Overrides:
remin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection- See Also:
-
addAll
public boolean addAll(long index, it.unimi.dsi.fastutil.booleans.BooleanCollection c) Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).- Specified by:
addAllin interfaceBooleanBigList- See Also:
-
addAll
public boolean addAll(it.unimi.dsi.fastutil.booleans.BooleanCollection c) - Specified by:
addAllin interfaceit.unimi.dsi.fastutil.booleans.BooleanCollection- Overrides:
addAllin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
-
add
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
addin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
addin interfaceBooleanBigList
-
set
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
setin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
setin interfaceBooleanBigList
-
get
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
getin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
getin interfaceBooleanBigList
-
indexOf
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
indexOfin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
indexOfin interfaceBooleanBigList
-
lastIndexOf
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
lastIndexOfin interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
lastIndexOfin interfaceBooleanBigList
-
remove
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
removein interfaceit.unimi.dsi.fastutil.BigList<Boolean>- Specified by:
removein interfaceBooleanBigList
-
push
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
pushin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack- Specified by:
pushin interfaceit.unimi.dsi.fastutil.Stack<Boolean>
-
pop
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
popin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack- Specified by:
popin interfaceit.unimi.dsi.fastutil.Stack<Boolean>
-
top
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
topin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack- Specified by:
topin interfaceit.unimi.dsi.fastutil.Stack<Boolean>
-
peek
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
peekin interfaceit.unimi.dsi.fastutil.booleans.BooleanStack- Specified by:
peekin interfaceit.unimi.dsi.fastutil.Stack<Boolean>
-
toString
- Overrides:
toStringin classit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
-