Class SynchronizedCharList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedCharCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.SynchronizedCharList
-
- All Implemented Interfaces:
java.io.Serializable
,CharIterable
,MutableCharCollection
,CharList
,MutableCharList
,OrderedCharIterable
,ReversibleCharIterable
,PrimitiveIterable
public class SynchronizedCharList extends AbstractSynchronizedCharCollection implements MutableCharList
A synchronized view of aMutableCharList
. 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:
MutableCharList.asSynchronized()
,MutableList.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedCharList(MutableCharList list)
SynchronizedCharList(MutableCharList list, java.lang.Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, char... source)
boolean
addAllAtIndex(int index, CharIterable source)
void
addAtIndex(int index, char element)
LazyCharIterable
asLazy()
Returns a LazyCharIterable adapter wrapping the source CharIterable.LazyCharIterable
asReversed()
MutableCharList
asSynchronized()
MutableCharList
asUnmodifiable()
int
binarySearch(char value)
<V> MutableList<V>
collect(CharToObjectFunction<? 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(CharIntToObjectFunction<? 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(CharIntToObjectFunction<? 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.MutableCharList
distinct()
long
dotProduct(CharList list)
boolean
equals(java.lang.Object otherList)
Follows the same general contract asList.equals(Object)
.void
forEachInBoth(CharList other, CharCharProcedure procedure)
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.void
forEachWithIndex(CharIntProcedure procedure)
char
get(int index)
char
getFirst()
char
getLast()
private MutableCharList
getMutableCharList()
int
hashCode()
Follows the same general contract asList.hashCode()
.int
indexOf(char value)
<T> T
injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)
int
lastIndexOf(char value)
MutableCharList
newEmpty()
Creates a new empty mutable version of the same List type.MutableCharList
reject(CharPredicate predicate)
Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.MutableCharList
rejectWithIndex(CharIntPredicate predicate)
Returns a new MutableCharList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableCharCollection>
RrejectWithIndex(CharIntPredicate predicate, R target)
Returns a new MutableCharCollection excluding all elements with corresponding indexes matching the specified predicate.char
removeAtIndex(int index)
MutableCharList
reverseThis()
MutableCharList
select(CharPredicate predicate)
Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.MutableCharList
selectWithIndex(CharIntPredicate predicate)
Returns a new MutableCharList including all elements with corresponding indexes matching the specified predicate.<R extends MutableCharCollection>
RselectWithIndex(CharIntPredicate predicate, R target)
Returns a new MutableCharCollection including all elements with corresponding indexes matching the specified predicate.char
set(int index, char element)
MutableCharList
shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this).MutableCharList
shuffleThis(java.util.Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this).MutableCharList
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).MutableCharList
sortThis(CharComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableCharList
sortThisBy(CharToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.<T> MutableCharList
sortThisBy(CharToObjectFunction<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
.MutableCharList
subList(int fromIndex, int toIndex)
ImmutableCharList
toImmutable()
Returns an immutable copy of this list.MutableCharList
toReversed()
SynchronizedCharList
with(char element)
SynchronizedCharList
withAll(CharIterable elements)
SynchronizedCharList
without(char element)
SynchronizedCharList
withoutAll(CharIterable elements)
<T> MutableList<CharObjectPair<T>>
zip(java.lang.Iterable<T> iterable)
Returns aMutableList
formed from thisMutableCharList
and aListIterable
by combining corresponding elements in pairs.MutableList<CharCharPair>
zipChar(CharIterable iterable)
Returns aMutableList
formed from thisMutableCharList
and anotherCharList
by combining corresponding elements in pairs.-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedCharCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, charIterator, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getCharCollection, 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.CharIterable
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.MutableCharCollection
add, addAll, addAll, charIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableCharList
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
-
SynchronizedCharList
public SynchronizedCharList(MutableCharList list)
-
SynchronizedCharList
public SynchronizedCharList(MutableCharList list, java.lang.Object newLock)
-
-
Method Detail
-
getMutableCharList
private MutableCharList getMutableCharList()
-
getFirst
public char getFirst()
- Specified by:
getFirst
in interfaceOrderedCharIterable
-
getLast
public char getLast()
- Specified by:
getLast
in interfaceReversibleCharIterable
-
indexOf
public int indexOf(char value)
- Specified by:
indexOf
in interfaceOrderedCharIterable
-
lastIndexOf
public int lastIndexOf(char value)
- Specified by:
lastIndexOf
in interfaceCharList
-
addAtIndex
public void addAtIndex(int index, char element)
- Specified by:
addAtIndex
in interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, char... source)
- Specified by:
addAllAtIndex
in interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, CharIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableCharList
-
removeAtIndex
public char removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableCharList
-
set
public char set(int index, char element)
- Specified by:
set
in interfaceMutableCharList
-
with
public SynchronizedCharList with(char element)
- Specified by:
with
in interfaceMutableCharCollection
- Specified by:
with
in interfaceMutableCharList
- Overrides:
with
in classAbstractSynchronizedCharCollection
-
without
public SynchronizedCharList without(char element)
- Specified by:
without
in interfaceMutableCharCollection
- Specified by:
without
in interfaceMutableCharList
- Overrides:
without
in classAbstractSynchronizedCharCollection
-
withAll
public SynchronizedCharList withAll(CharIterable elements)
- Specified by:
withAll
in interfaceMutableCharCollection
- Specified by:
withAll
in interfaceMutableCharList
- Overrides:
withAll
in classAbstractSynchronizedCharCollection
-
withoutAll
public SynchronizedCharList withoutAll(CharIterable elements)
- Specified by:
withoutAll
in interfaceMutableCharCollection
- Specified by:
withoutAll
in interfaceMutableCharList
- Overrides:
withoutAll
in classAbstractSynchronizedCharCollection
-
select
public MutableCharList select(CharPredicate predicate)
Description copied from interface:CharIterable
Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.- Specified by:
select
in interfaceCharIterable
- Specified by:
select
in interfaceCharList
- Specified by:
select
in interfaceMutableCharCollection
- Specified by:
select
in interfaceMutableCharList
- Specified by:
select
in interfaceOrderedCharIterable
- Specified by:
select
in interfaceReversibleCharIterable
- Overrides:
select
in classAbstractSynchronizedCharCollection
-
reject
public MutableCharList reject(CharPredicate predicate)
Description copied from interface:CharIterable
Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.- Specified by:
reject
in interfaceCharIterable
- Specified by:
reject
in interfaceCharList
- Specified by:
reject
in interfaceMutableCharCollection
- Specified by:
reject
in interfaceMutableCharList
- Specified by:
reject
in interfaceOrderedCharIterable
- Specified by:
reject
in interfaceReversibleCharIterable
- Overrides:
reject
in classAbstractSynchronizedCharCollection
-
collect
public <V> MutableList<V> collect(CharToObjectFunction<? extends V> function)
Description copied from interface:CharIterable
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 interfaceCharIterable
- Specified by:
collect
in interfaceCharList
- Specified by:
collect
in interfaceMutableCharCollection
- Specified by:
collect
in interfaceMutableCharList
- Specified by:
collect
in interfaceOrderedCharIterable
- Specified by:
collect
in interfaceReversibleCharIterable
- Overrides:
collect
in classAbstractSynchronizedCharCollection
-
sortThis
public MutableCharList sortThis()
Description copied from interface:MutableCharList
Sorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThis
in interfaceMutableCharList
-
sortThis
public MutableCharList sortThis(CharComparator comparator)
Description copied from interface:MutableCharList
Sorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThis
in interfaceMutableCharList
-
sortThisBy
public <T> MutableCharList sortThisBy(CharToObjectFunction<T> function)
Description copied from interface:MutableCharList
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.- Specified by:
sortThisBy
in interfaceMutableCharList
-
sortThisBy
public <T> MutableCharList sortThisBy(CharToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Description copied from interface:MutableCharList
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.- Specified by:
sortThisBy
in interfaceMutableCharList
-
shuffleThis
public MutableCharList shuffleThis()
Description copied from interface:MutableCharList
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 interfaceMutableCharList
-
shuffleThis
public MutableCharList shuffleThis(java.util.Random rnd)
Description copied from interface:MutableCharList
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 interfaceMutableCharList
-
binarySearch
public int binarySearch(char value)
- Specified by:
binarySearch
in interfaceCharList
-
dotProduct
public long dotProduct(CharList list)
- Specified by:
dotProduct
in interfaceCharList
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:CharList
Follows the same general contract asList.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:CharList
Follows the same general contract asList.hashCode()
.
-
asLazy
public LazyCharIterable asLazy()
Description copied from interface:CharIterable
Returns a LazyCharIterable adapter wrapping the source CharIterable.- Specified by:
asLazy
in interfaceCharIterable
- Overrides:
asLazy
in classAbstractSynchronizedCharCollection
-
asUnmodifiable
public MutableCharList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableCharCollection
- Specified by:
asUnmodifiable
in interfaceMutableCharList
- Overrides:
asUnmodifiable
in classAbstractSynchronizedCharCollection
-
asSynchronized
public MutableCharList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableCharCollection
- Specified by:
asSynchronized
in interfaceMutableCharList
- Overrides:
asSynchronized
in classAbstractSynchronizedCharCollection
-
toImmutable
public ImmutableCharList toImmutable()
Description copied from interface:MutableCharList
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceCharList
- Specified by:
toImmutable
in interfaceMutableCharCollection
- Specified by:
toImmutable
in interfaceMutableCharList
- Overrides:
toImmutable
in classAbstractSynchronizedCharCollection
-
newEmpty
public MutableCharList newEmpty()
Description copied from interface:MutableCharList
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableCharCollection
- Specified by:
newEmpty
in interfaceMutableCharList
- Since:
- 9.2.
-
reverseThis
public MutableCharList reverseThis()
- Specified by:
reverseThis
in interfaceMutableCharList
-
toReversed
public MutableCharList toReversed()
- Specified by:
toReversed
in interfaceCharList
- Specified by:
toReversed
in interfaceMutableCharList
- Specified by:
toReversed
in interfaceReversibleCharIterable
-
asReversed
public LazyCharIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleCharIterable
-
forEachInBoth
public void forEachInBoth(CharList other, CharCharProcedure procedure)
Description copied from interface:CharList
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBoth
in interfaceCharList
-
forEachWithIndex
public void forEachWithIndex(CharIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedCharIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedCharIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleCharIterable
-
distinct
public MutableCharList distinct()
- Specified by:
distinct
in interfaceCharList
- Specified by:
distinct
in interfaceMutableCharList
- Specified by:
distinct
in interfaceReversibleCharIterable
- Since:
- 6.0.
-
subList
public MutableCharList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceCharList
- Specified by:
subList
in interfaceMutableCharList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipChar
public MutableList<CharCharPair> zipChar(CharIterable iterable)
Description copied from interface:MutableCharList
Returns aMutableList
formed from thisMutableCharList
and anotherCharList
by combining corresponding elements in pairs. If one of the twoCharList
s is longer than the other, its remaining elements are ignored.- Specified by:
zipChar
in interfaceCharList
- Specified by:
zipChar
in interfaceMutableCharList
- Since:
- 9.1.
-
zip
public <T> MutableList<CharObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableCharList
Returns aMutableList
formed from thisMutableCharList
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 interfaceCharList
- Specified by:
zip
in interfaceMutableCharList
- Since:
- 9.1.
-
selectWithIndex
public MutableCharList selectWithIndex(CharIntPredicate predicate)
Returns a new MutableCharList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceCharList
- Specified by:
selectWithIndex
in interfaceMutableCharList
- Specified by:
selectWithIndex
in interfaceOrderedCharIterable
- Specified by:
selectWithIndex
in interfaceReversibleCharIterable
- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableCharCollection> R selectWithIndex(CharIntPredicate predicate, R target)
Returns a new MutableCharCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedCharIterable
- Since:
- 11.1.
-
rejectWithIndex
public MutableCharList rejectWithIndex(CharIntPredicate predicate)
Returns a new MutableCharList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceCharList
- Specified by:
rejectWithIndex
in interfaceMutableCharList
- Specified by:
rejectWithIndex
in interfaceOrderedCharIterable
- Specified by:
rejectWithIndex
in interfaceReversibleCharIterable
- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableCharCollection> R rejectWithIndex(CharIntPredicate predicate, R target)
Returns a new MutableCharCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedCharIterable
- Since:
- 11.1.
-
collectWithIndex
public <V> MutableList<V> collectWithIndex(CharIntToObjectFunction<? 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 interfaceCharList
- Specified by:
collectWithIndex
in interfaceMutableCharList
- Specified by:
collectWithIndex
in interfaceOrderedCharIterable
- Specified by:
collectWithIndex
in interfaceReversibleCharIterable
- Since:
- 9.1.
-
collectWithIndex
public <V,R extends java.util.Collection<V>> R collectWithIndex(CharIntToObjectFunction<? 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 interfaceOrderedCharIterable
- Since:
- 9.1.
-
-