Class SynchronizedByteList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedByteCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.SynchronizedByteList
-
- All Implemented Interfaces:
java.io.Serializable
,ByteIterable
,MutableByteCollection
,ByteList
,MutableByteList
,OrderedByteIterable
,ReversibleByteIterable
,PrimitiveIterable
public class SynchronizedByteList extends AbstractSynchronizedByteCollection implements MutableByteList
A synchronized view of aMutableByteList
. It is imperative that the user manually synchronize on the on the collection when iterating over it using an iterator or stream.This file was automatically generated from template file synchronizedPrimitiveList.stg.
- Since:
- 3.1.
- See Also:
MutableByteList.asSynchronized()
,MutableList.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedByteList(MutableByteList list)
SynchronizedByteList(MutableByteList list, java.lang.Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, byte... source)
boolean
addAllAtIndex(int index, ByteIterable source)
void
addAtIndex(int index, byte element)
LazyByteIterable
asLazy()
Returns a LazyByteIterable adapter wrapping the source ByteIterable.LazyByteIterable
asReversed()
MutableByteList
asSynchronized()
MutableByteList
asUnmodifiable()
int
binarySearch(byte value)
<V> MutableList<V>
collect(ByteToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.<V> MutableList<V>
collectWithIndex(ByteIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.<V,R extends java.util.Collection<V>>
RcollectWithIndex(ByteIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.MutableByteList
distinct()
long
dotProduct(ByteList list)
boolean
equals(java.lang.Object otherList)
Follows the same general contract asList.equals(Object)
.void
forEachInBoth(ByteList other, ByteByteProcedure procedure)
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.void
forEachWithIndex(ByteIntProcedure procedure)
byte
get(int index)
byte
getFirst()
byte
getLast()
private MutableByteList
getMutableByteList()
int
hashCode()
Follows the same general contract asList.hashCode()
.int
indexOf(byte value)
<T> T
injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)
int
lastIndexOf(byte value)
MutableByteList
newEmpty()
Creates a new empty mutable version of the same List type.MutableByteList
reject(BytePredicate predicate)
Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.MutableByteList
rejectWithIndex(ByteIntPredicate predicate)
Returns a new MutableByteList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableByteCollection>
RrejectWithIndex(ByteIntPredicate predicate, R target)
Returns a new MutableByteCollection excluding all elements with corresponding indexes matching the specified predicate.byte
removeAtIndex(int index)
MutableByteList
reverseThis()
MutableByteList
select(BytePredicate predicate)
Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.MutableByteList
selectWithIndex(ByteIntPredicate predicate)
Returns a new MutableByteList including all elements with corresponding indexes matching the specified predicate.<R extends MutableByteCollection>
RselectWithIndex(ByteIntPredicate predicate, R target)
Returns a new MutableByteCollection including all elements with corresponding indexes matching the specified predicate.byte
set(int index, byte element)
MutableByteList
shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this).MutableByteList
shuffleThis(java.util.Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this).MutableByteList
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).MutableByteList
sortThis(ByteComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableByteList
sortThisBy(ByteToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.<T> MutableByteList
sortThisBy(ByteToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.MutableByteList
subList(int fromIndex, int toIndex)
ImmutableByteList
toImmutable()
Returns an immutable copy of this list.MutableByteList
toReversed()
SynchronizedByteList
with(byte element)
SynchronizedByteList
withAll(ByteIterable elements)
SynchronizedByteList
without(byte element)
SynchronizedByteList
withoutAll(ByteIterable elements)
<T> MutableList<ByteObjectPair<T>>
zip(java.lang.Iterable<T> iterable)
Returns aMutableList
formed from thisMutableByteList
and aListIterable
by combining corresponding elements in pairs.MutableList<ByteBytePair>
zipByte(ByteIterable iterable)
Returns aMutableList
formed from thisMutableByteList
and anotherByteList
by combining corresponding elements in pairs.-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedByteCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, byteIterator, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getByteCollection, getLock, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.ByteIterable
allSatisfy, anySatisfy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableByteCollection
add, addAll, addAll, byteIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableByteList
swap, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizedByteList
public SynchronizedByteList(MutableByteList list)
-
SynchronizedByteList
public SynchronizedByteList(MutableByteList list, java.lang.Object newLock)
-
-
Method Detail
-
getMutableByteList
private MutableByteList getMutableByteList()
-
getFirst
public byte getFirst()
- Specified by:
getFirst
in interfaceOrderedByteIterable
-
getLast
public byte getLast()
- Specified by:
getLast
in interfaceReversibleByteIterable
-
indexOf
public int indexOf(byte value)
- Specified by:
indexOf
in interfaceOrderedByteIterable
-
lastIndexOf
public int lastIndexOf(byte value)
- Specified by:
lastIndexOf
in interfaceByteList
-
addAtIndex
public void addAtIndex(int index, byte element)
- Specified by:
addAtIndex
in interfaceMutableByteList
-
addAllAtIndex
public boolean addAllAtIndex(int index, byte... source)
- Specified by:
addAllAtIndex
in interfaceMutableByteList
-
addAllAtIndex
public boolean addAllAtIndex(int index, ByteIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableByteList
-
removeAtIndex
public byte removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableByteList
-
set
public byte set(int index, byte element)
- Specified by:
set
in interfaceMutableByteList
-
with
public SynchronizedByteList with(byte element)
- Specified by:
with
in interfaceMutableByteCollection
- Specified by:
with
in interfaceMutableByteList
- Overrides:
with
in classAbstractSynchronizedByteCollection
-
without
public SynchronizedByteList without(byte element)
- Specified by:
without
in interfaceMutableByteCollection
- Specified by:
without
in interfaceMutableByteList
- Overrides:
without
in classAbstractSynchronizedByteCollection
-
withAll
public SynchronizedByteList withAll(ByteIterable elements)
- Specified by:
withAll
in interfaceMutableByteCollection
- Specified by:
withAll
in interfaceMutableByteList
- Overrides:
withAll
in classAbstractSynchronizedByteCollection
-
withoutAll
public SynchronizedByteList withoutAll(ByteIterable elements)
- Specified by:
withoutAll
in interfaceMutableByteCollection
- Specified by:
withoutAll
in interfaceMutableByteList
- Overrides:
withoutAll
in classAbstractSynchronizedByteCollection
-
select
public MutableByteList select(BytePredicate predicate)
Description copied from interface:ByteIterable
Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.- Specified by:
select
in interfaceByteIterable
- Specified by:
select
in interfaceByteList
- Specified by:
select
in interfaceMutableByteCollection
- Specified by:
select
in interfaceMutableByteList
- Specified by:
select
in interfaceOrderedByteIterable
- Specified by:
select
in interfaceReversibleByteIterable
- Overrides:
select
in classAbstractSynchronizedByteCollection
-
reject
public MutableByteList reject(BytePredicate predicate)
Description copied from interface:ByteIterable
Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.- Specified by:
reject
in interfaceByteIterable
- Specified by:
reject
in interfaceByteList
- Specified by:
reject
in interfaceMutableByteCollection
- Specified by:
reject
in interfaceMutableByteList
- Specified by:
reject
in interfaceOrderedByteIterable
- Specified by:
reject
in interfaceReversibleByteIterable
- Overrides:
reject
in classAbstractSynchronizedByteCollection
-
collect
public <V> MutableList<V> collect(ByteToObjectFunction<? extends V> function)
Description copied from interface:ByteIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceByteIterable
- Specified by:
collect
in interfaceByteList
- Specified by:
collect
in interfaceMutableByteCollection
- Specified by:
collect
in interfaceMutableByteList
- Specified by:
collect
in interfaceOrderedByteIterable
- Specified by:
collect
in interfaceReversibleByteIterable
- Overrides:
collect
in classAbstractSynchronizedByteCollection
-
sortThis
public MutableByteList sortThis()
Description copied from interface:MutableByteList
Sorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThis
in interfaceMutableByteList
-
sortThis
public MutableByteList sortThis(ByteComparator comparator)
Description copied from interface:MutableByteList
Sorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThis
in interfaceMutableByteList
-
sortThisBy
public <T> MutableByteList sortThisBy(ByteToObjectFunction<T> function)
Description copied from interface:MutableByteList
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.- Specified by:
sortThisBy
in interfaceMutableByteList
-
sortThisBy
public <T> MutableByteList sortThisBy(ByteToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Description copied from interface:MutableByteList
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.- Specified by:
sortThisBy
in interfaceMutableByteList
-
shuffleThis
public MutableByteList shuffleThis()
Description copied from interface:MutableByteList
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness.- Specified by:
shuffleThis
in interfaceMutableByteList
-
shuffleThis
public MutableByteList shuffleThis(java.util.Random rnd)
Description copied from interface:MutableByteList
Randomly permutes this list mutating its contents and returns the same list (this). Implements the Fisher-Yates shuffle algorithm using the provided source of randomness.- Specified by:
shuffleThis
in interfaceMutableByteList
-
binarySearch
public int binarySearch(byte value)
- Specified by:
binarySearch
in interfaceByteList
-
dotProduct
public long dotProduct(ByteList list)
- Specified by:
dotProduct
in interfaceByteList
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:ByteList
Follows the same general contract asList.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:ByteList
Follows the same general contract asList.hashCode()
.
-
asLazy
public LazyByteIterable asLazy()
Description copied from interface:ByteIterable
Returns a LazyByteIterable adapter wrapping the source ByteIterable.- Specified by:
asLazy
in interfaceByteIterable
- Overrides:
asLazy
in classAbstractSynchronizedByteCollection
-
asUnmodifiable
public MutableByteList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableByteCollection
- Specified by:
asUnmodifiable
in interfaceMutableByteList
- Overrides:
asUnmodifiable
in classAbstractSynchronizedByteCollection
-
asSynchronized
public MutableByteList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableByteCollection
- Specified by:
asSynchronized
in interfaceMutableByteList
- Overrides:
asSynchronized
in classAbstractSynchronizedByteCollection
-
toImmutable
public ImmutableByteList toImmutable()
Description copied from interface:MutableByteList
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceByteList
- Specified by:
toImmutable
in interfaceMutableByteCollection
- Specified by:
toImmutable
in interfaceMutableByteList
- Overrides:
toImmutable
in classAbstractSynchronizedByteCollection
-
newEmpty
public MutableByteList newEmpty()
Description copied from interface:MutableByteList
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableByteCollection
- Specified by:
newEmpty
in interfaceMutableByteList
- Since:
- 9.2.
-
reverseThis
public MutableByteList reverseThis()
- Specified by:
reverseThis
in interfaceMutableByteList
-
toReversed
public MutableByteList toReversed()
- Specified by:
toReversed
in interfaceByteList
- Specified by:
toReversed
in interfaceMutableByteList
- Specified by:
toReversed
in interfaceReversibleByteIterable
-
asReversed
public LazyByteIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleByteIterable
-
forEachInBoth
public void forEachInBoth(ByteList other, ByteByteProcedure procedure)
Description copied from interface:ByteList
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBoth
in interfaceByteList
-
forEachWithIndex
public void forEachWithIndex(ByteIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedByteIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedByteIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleByteIterable
-
distinct
public MutableByteList distinct()
- Specified by:
distinct
in interfaceByteList
- Specified by:
distinct
in interfaceMutableByteList
- Specified by:
distinct
in interfaceReversibleByteIterable
- Since:
- 6.0.
-
subList
public MutableByteList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceByteList
- Specified by:
subList
in interfaceMutableByteList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipByte
public MutableList<ByteBytePair> zipByte(ByteIterable iterable)
Description copied from interface:MutableByteList
Returns aMutableList
formed from thisMutableByteList
and anotherByteList
by combining corresponding elements in pairs. If one of the twoByteList
s is longer than the other, its remaining elements are ignored.- Specified by:
zipByte
in interfaceByteList
- Specified by:
zipByte
in interfaceMutableByteList
- Since:
- 9.1.
-
zip
public <T> MutableList<ByteObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableByteList
Returns aMutableList
formed from thisMutableByteList
and aListIterable
by combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zip
in interfaceByteList
- Specified by:
zip
in interfaceMutableByteList
- Since:
- 9.1.
-
selectWithIndex
public MutableByteList selectWithIndex(ByteIntPredicate predicate)
Returns a new MutableByteList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceByteList
- Specified by:
selectWithIndex
in interfaceMutableByteList
- Specified by:
selectWithIndex
in interfaceOrderedByteIterable
- Specified by:
selectWithIndex
in interfaceReversibleByteIterable
- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableByteCollection> R selectWithIndex(ByteIntPredicate predicate, R target)
Returns a new MutableByteCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedByteIterable
- Since:
- 11.1.
-
rejectWithIndex
public MutableByteList rejectWithIndex(ByteIntPredicate predicate)
Returns a new MutableByteList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceByteList
- Specified by:
rejectWithIndex
in interfaceMutableByteList
- Specified by:
rejectWithIndex
in interfaceOrderedByteIterable
- Specified by:
rejectWithIndex
in interfaceReversibleByteIterable
- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableByteCollection> R rejectWithIndex(ByteIntPredicate predicate, R target)
Returns a new MutableByteCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedByteIterable
- Since:
- 11.1.
-
collectWithIndex
public <V> MutableList<V> collectWithIndex(ByteIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceByteList
- Specified by:
collectWithIndex
in interfaceMutableByteList
- Specified by:
collectWithIndex
in interfaceOrderedByteIterable
- Specified by:
collectWithIndex
in interfaceReversibleByteIterable
- Since:
- 9.1.
-
collectWithIndex
public <V,R extends java.util.Collection<V>> R collectWithIndex(ByteIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceOrderedByteIterable
- Since:
- 9.1.
-
-