Class SynchronizedByteList
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedByteCollection
org.eclipse.collections.impl.list.mutable.primitive.SynchronizedByteList
- All Implemented Interfaces:
Serializable,ByteIterable,MutableByteCollection,ByteList,MutableByteList,OrderedByteIterable,ReversibleByteIterable,PrimitiveIterable
public class SynchronizedByteList extends AbstractSynchronizedByteCollection implements MutableByteList
A synchronized view of a
MutableByteList. 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
-
Constructor Summary
Constructors Constructor Description SynchronizedByteList(MutableByteList list)SynchronizedByteList(MutableByteList list, Object newLock) -
Method Summary
Modifier and Type Method Description booleanaddAllAtIndex(int index, byte... source)booleanaddAllAtIndex(int index, ByteIterable source)voidaddAtIndex(int index, byte element)LazyByteIterableasLazy()Returns a LazyByteIterable adapter wrapping the source ByteIterable.LazyByteIterableasReversed()MutableByteListasSynchronized()MutableByteListasUnmodifiable()intbinarySearch(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 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.MutableByteListdistinct()longdotProduct(ByteList list)booleanequals(Object otherList)Follows the same general contract asList.equals(Object).voidforEachWithIndex(ByteIntProcedure procedure)byteget(int index)bytegetFirst()bytegetLast()inthashCode()Follows the same general contract asList.hashCode().intindexOf(byte value)<T> TinjectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(byte value)MutableByteListnewEmpty()Creates a new empty mutable version of the same List type.MutableByteListreject(BytePredicate predicate)Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.byteremoveAtIndex(int index)MutableByteListreverseThis()MutableByteListselect(BytePredicate predicate)Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.byteset(int index, byte element)MutableByteListshuffleThis()Randomly permutes this list mutating its contents and returns the same list (this).MutableByteListshuffleThis(Random rnd)Randomly permutes this list mutating its contents and returns the same list (this).MutableByteListsortThis()Sorts this list mutating its contents and returns the same mutable list (this).MutableByteListsortThis(ByteComparator comparator)Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableByteListsortThisBy(ByteToObjectFunction<T> function)Sorts the internal data structure of this list based on the natural order of the key returned byfunction.<T> MutableByteListsortThisBy(ByteToObjectFunction<T> function, Comparator<? super T> comparator)Sorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.MutableByteListsubList(int fromIndex, int toIndex)ImmutableByteListtoImmutable()Returns an immutable copy of this list.MutableByteListtoReversed()SynchronizedByteListwith(byte element)SynchronizedByteListwithAll(ByteIterable elements)SynchronizedByteListwithout(byte element)SynchronizedByteListwithoutAll(ByteIterable elements)<T> MutableList<ByteObjectPair<T>>zip(Iterable<T> iterable)Returns aMutableListformed from thisMutableByteListand aListIterableby combining corresponding elements in pairs.MutableList<ByteBytePair>zipByte(ByteIterable iterable)Returns aMutableListformed from thisMutableByteListand anotherByteListby 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, count, detectIfNone, each, forEach, 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, toStringMethods 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, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedListMethods inherited from interface org.eclipse.collections.api.collection.primitive.MutableByteCollection
add, addAll, addAll, byteIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAllMethods inherited from interface org.eclipse.collections.api.list.primitive.MutableByteList
swap, tapMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
Method Details
-
get
public byte get(int index) -
getFirst
public byte getFirst()- Specified by:
getFirstin interfaceOrderedByteIterable
-
getLast
public byte getLast()- Specified by:
getLastin interfaceReversibleByteIterable
-
indexOf
public int indexOf(byte value)- Specified by:
indexOfin interfaceOrderedByteIterable
-
lastIndexOf
public int lastIndexOf(byte value)- Specified by:
lastIndexOfin interfaceByteList
-
addAtIndex
public void addAtIndex(int index, byte element)- Specified by:
addAtIndexin interfaceMutableByteList
-
addAllAtIndex
public boolean addAllAtIndex(int index, byte... source)- Specified by:
addAllAtIndexin interfaceMutableByteList
-
addAllAtIndex
- Specified by:
addAllAtIndexin interfaceMutableByteList
-
removeAtIndex
public byte removeAtIndex(int index)- Specified by:
removeAtIndexin interfaceMutableByteList
-
set
public byte set(int index, byte element)- Specified by:
setin interfaceMutableByteList
-
with
- Specified by:
within interfaceMutableByteCollection- Specified by:
within interfaceMutableByteList- Overrides:
within classAbstractSynchronizedByteCollection
-
without
- Specified by:
withoutin interfaceMutableByteCollection- Specified by:
withoutin interfaceMutableByteList- Overrides:
withoutin classAbstractSynchronizedByteCollection
-
withAll
- Specified by:
withAllin interfaceMutableByteCollection- Specified by:
withAllin interfaceMutableByteList- Overrides:
withAllin classAbstractSynchronizedByteCollection
-
withoutAll
- Specified by:
withoutAllin interfaceMutableByteCollection- Specified by:
withoutAllin interfaceMutableByteList- Overrides:
withoutAllin classAbstractSynchronizedByteCollection
-
select
Description copied from interface:ByteIterableReturns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.- Specified by:
selectin interfaceByteIterable- Specified by:
selectin interfaceByteList- Specified by:
selectin interfaceMutableByteCollection- Specified by:
selectin interfaceMutableByteList- Specified by:
selectin interfaceOrderedByteIterable- Specified by:
selectin interfaceReversibleByteIterable- Overrides:
selectin classAbstractSynchronizedByteCollection
-
reject
Description copied from interface:ByteIterableReturns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.- Specified by:
rejectin interfaceByteIterable- Specified by:
rejectin interfaceByteList- Specified by:
rejectin interfaceMutableByteCollection- Specified by:
rejectin interfaceMutableByteList- Specified by:
rejectin interfaceOrderedByteIterable- Specified by:
rejectin interfaceReversibleByteIterable- Overrides:
rejectin classAbstractSynchronizedByteCollection
-
collect
Description copied from interface:ByteIterableReturns 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:
collectin interfaceByteIterable- Specified by:
collectin interfaceByteList- Specified by:
collectin interfaceMutableByteCollection- Specified by:
collectin interfaceMutableByteList- Specified by:
collectin interfaceOrderedByteIterable- Specified by:
collectin interfaceReversibleByteIterable- Overrides:
collectin classAbstractSynchronizedByteCollection
-
sortThis
Description copied from interface:MutableByteListSorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThisin interfaceMutableByteList
-
sortThis
Description copied from interface:MutableByteListSorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThisin interfaceMutableByteList
-
sortThisBy
Description copied from interface:MutableByteListSorts the internal data structure of this list based on the natural order of the key returned byfunction.- Specified by:
sortThisByin interfaceMutableByteList
-
sortThisBy
public <T> MutableByteList sortThisBy(ByteToObjectFunction<T> function, Comparator<? super T> comparator)Description copied from interface:MutableByteListSorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.- Specified by:
sortThisByin interfaceMutableByteList
-
shuffleThis
Description copied from interface:MutableByteListRandomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Randomas the source of randomness.- Specified by:
shuffleThisin interfaceMutableByteList
-
shuffleThis
Description copied from interface:MutableByteListRandomly 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:
shuffleThisin interfaceMutableByteList
-
binarySearch
public int binarySearch(byte value)- Specified by:
binarySearchin interfaceByteList
-
dotProduct
- Specified by:
dotProductin interfaceByteList
-
equals
Description copied from interface:ByteListFollows the same general contract asList.equals(Object). -
hashCode
public int hashCode()Description copied from interface:ByteListFollows the same general contract asList.hashCode(). -
asLazy
Description copied from interface:ByteIterableReturns a LazyByteIterable adapter wrapping the source ByteIterable.- Specified by:
asLazyin interfaceByteIterable- Overrides:
asLazyin classAbstractSynchronizedByteCollection
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableByteCollection- Specified by:
asUnmodifiablein interfaceMutableByteList- Overrides:
asUnmodifiablein classAbstractSynchronizedByteCollection
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableByteCollection- Specified by:
asSynchronizedin interfaceMutableByteList- Overrides:
asSynchronizedin classAbstractSynchronizedByteCollection
-
toImmutable
Description copied from interface:MutableByteListReturns an immutable copy of this list.- Specified by:
toImmutablein interfaceByteList- Specified by:
toImmutablein interfaceMutableByteCollection- Specified by:
toImmutablein interfaceMutableByteList- Overrides:
toImmutablein classAbstractSynchronizedByteCollection
-
newEmpty
Description copied from interface:MutableByteListCreates a new empty mutable version of the same List type.- Specified by:
newEmptyin interfaceMutableByteCollection- Specified by:
newEmptyin interfaceMutableByteList- Since:
- 9.2.
-
reverseThis
- Specified by:
reverseThisin interfaceMutableByteList
-
toReversed
- Specified by:
toReversedin interfaceByteList- Specified by:
toReversedin interfaceMutableByteList- Specified by:
toReversedin interfaceReversibleByteIterable
-
asReversed
- Specified by:
asReversedin interfaceReversibleByteIterable
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedByteIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedByteIterable- Specified by:
injectIntoWithIndexin interfaceReversibleByteIterable
-
distinct
- Specified by:
distinctin interfaceByteList- Specified by:
distinctin interfaceMutableByteList- Specified by:
distinctin interfaceReversibleByteIterable- Since:
- 6.0.
-
subList
- Specified by:
subListin interfaceByteList- Specified by:
subListin interfaceMutableByteList- See Also:
List.subList(int fromIndex, int toIndex)
-
zipByte
Description copied from interface:MutableByteListReturns aMutableListformed from thisMutableByteListand anotherByteListby combining corresponding elements in pairs. If one of the twoByteLists is longer than the other, its remaining elements are ignored.- Specified by:
zipBytein interfaceByteList- Specified by:
zipBytein interfaceMutableByteList- Since:
- 9.1.
-
zip
Description copied from interface:MutableByteListReturns aMutableListformed from thisMutableByteListand aListIterableby combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zipin interfaceByteList- Specified by:
zipin interfaceMutableByteList- Since:
- 9.1.
-
collectWithIndex
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceByteList- Specified by:
collectWithIndexin interfaceMutableByteList- Specified by:
collectWithIndexin interfaceOrderedByteIterable- Specified by:
collectWithIndexin interfaceReversibleByteIterable- Since:
- 9.1.
-
collectWithIndex
public <V, R extends 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:
collectWithIndexin interfaceOrderedByteIterable- Since:
- 9.1.
-