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 longserialVersionUID
-
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 booleanaddAllAtIndex(int index, char... source)booleanaddAllAtIndex(int index, CharIterable source)voidaddAtIndex(int index, char element)LazyCharIterableasLazy()Returns a LazyCharIterable adapter wrapping the source CharIterable.LazyCharIterableasReversed()MutableCharListasSynchronized()MutableCharListasUnmodifiable()intbinarySearch(char value)MutableList<java.lang.Character>boxed()<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.MutableCharListdistinct()longdotProduct(CharList list)booleanequals(java.lang.Object otherList)Follows the same general contract asList.equals(Object).voidforEachInBoth(CharList other, CharCharProcedure procedure)This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.voidforEachWithIndex(CharIntProcedure procedure)charget(int index)chargetFirst()chargetLast()private MutableCharListgetMutableCharList()inthashCode()Follows the same general contract asList.hashCode().intindexOf(char value)<T> TinjectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(char value)MutableCharListnewEmpty()Creates a new empty mutable version of the same List type.MutableCharListreject(CharPredicate predicate)Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.MutableCharListrejectWithIndex(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.charremoveAtIndex(int index)MutableCharListreverseThis()MutableCharListselect(CharPredicate predicate)Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.MutableCharListselectWithIndex(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.charset(int index, char element)MutableCharListshuffleThis()Randomly permutes this list mutating its contents and returns the same list (this).MutableCharListshuffleThis(java.util.Random rnd)Randomly permutes this list mutating its contents and returns the same list (this).MutableCharListsortThis()Sorts this list mutating its contents and returns the same mutable list (this).MutableCharListsortThis(CharComparator comparator)Sorts the internal data structure of this list and returns the list itself as a convenience.<T> MutableCharListsortThisBy(CharToObjectFunction<T> function)Sorts the internal data structure of this list based on the natural order of the key returned byfunction.<T> MutableCharListsortThisBy(CharToObjectFunction<T> function, java.util.Comparator<? super T> comparator)Sorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.MutableCharListsubList(int fromIndex, int toIndex)ImmutableCharListtoImmutable()Returns an immutable copy of this list.MutableCharListtoReversed()MutableCharStacktoStack()Converts the collection to a CharStack.SynchronizedCharListwith(char element)SynchronizedCharListwithAll(CharIterable elements)SynchronizedCharListwithout(char element)SynchronizedCharListwithoutAll(CharIterable elements)<T> MutableList<CharObjectPair<T>>zip(java.lang.Iterable<T> iterable)Returns aMutableListformed from thisMutableCharListand aListIterableby combining corresponding elements in pairs.MutableList<CharCharPair>zipChar(CharIterable iterable)Returns aMutableListformed from thisMutableCharListand anotherCharListby 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:
getFirstin interfaceOrderedCharIterable
-
getLast
public char getLast()
- Specified by:
getLastin interfaceReversibleCharIterable
-
indexOf
public int indexOf(char value)
- Specified by:
indexOfin interfaceOrderedCharIterable
-
lastIndexOf
public int lastIndexOf(char value)
- Specified by:
lastIndexOfin interfaceCharList
-
addAtIndex
public void addAtIndex(int index, char element)- Specified by:
addAtIndexin interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, char... source)- Specified by:
addAllAtIndexin interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, CharIterable source)- Specified by:
addAllAtIndexin interfaceMutableCharList
-
removeAtIndex
public char removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableCharList
-
set
public char set(int index, char element)- Specified by:
setin interfaceMutableCharList
-
with
public SynchronizedCharList with(char element)
- Specified by:
within interfaceMutableCharCollection- Specified by:
within interfaceMutableCharList- Overrides:
within classAbstractSynchronizedCharCollection
-
without
public SynchronizedCharList without(char element)
- Specified by:
withoutin interfaceMutableCharCollection- Specified by:
withoutin interfaceMutableCharList- Overrides:
withoutin classAbstractSynchronizedCharCollection
-
withAll
public SynchronizedCharList withAll(CharIterable elements)
- Specified by:
withAllin interfaceMutableCharCollection- Specified by:
withAllin interfaceMutableCharList- Overrides:
withAllin classAbstractSynchronizedCharCollection
-
withoutAll
public SynchronizedCharList withoutAll(CharIterable elements)
- Specified by:
withoutAllin interfaceMutableCharCollection- Specified by:
withoutAllin interfaceMutableCharList- Overrides:
withoutAllin classAbstractSynchronizedCharCollection
-
select
public MutableCharList select(CharPredicate predicate)
Description copied from interface:CharIterableReturns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceCharList- Specified by:
selectin interfaceMutableCharCollection- Specified by:
selectin interfaceMutableCharList- Specified by:
selectin interfaceOrderedCharIterable- Specified by:
selectin interfaceReversibleCharIterable- Overrides:
selectin classAbstractSynchronizedCharCollection
-
boxed
public MutableList<java.lang.Character> boxed()
- Specified by:
boxedin interfaceMutableCharList
-
reject
public MutableCharList reject(CharPredicate predicate)
Description copied from interface:CharIterableReturns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceCharList- Specified by:
rejectin interfaceMutableCharCollection- Specified by:
rejectin interfaceMutableCharList- Specified by:
rejectin interfaceOrderedCharIterable- Specified by:
rejectin interfaceReversibleCharIterable- Overrides:
rejectin classAbstractSynchronizedCharCollection
-
collect
public <V> MutableList<V> collect(CharToObjectFunction<? extends V> function)
Description copied from interface:CharIterableReturns 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 interfaceCharIterable- Specified by:
collectin interfaceCharList- Specified by:
collectin interfaceMutableCharCollection- Specified by:
collectin interfaceMutableCharList- Specified by:
collectin interfaceOrderedCharIterable- Specified by:
collectin interfaceReversibleCharIterable- Overrides:
collectin classAbstractSynchronizedCharCollection
-
sortThis
public MutableCharList sortThis()
Description copied from interface:MutableCharListSorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThisin interfaceMutableCharList
-
sortThis
public MutableCharList sortThis(CharComparator comparator)
Description copied from interface:MutableCharListSorts the internal data structure of this list and returns the list itself as a convenience.- Specified by:
sortThisin interfaceMutableCharList
-
sortThisBy
public <T> MutableCharList sortThisBy(CharToObjectFunction<T> function)
Description copied from interface:MutableCharListSorts the internal data structure of this list based on the natural order of the key returned byfunction.- Specified by:
sortThisByin interfaceMutableCharList
-
sortThisBy
public <T> MutableCharList sortThisBy(CharToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Description copied from interface:MutableCharListSorts the internal data structure of this list based on the key returned byfunctionusing the providedcomparator.- Specified by:
sortThisByin interfaceMutableCharList
-
shuffleThis
public MutableCharList shuffleThis()
Description copied from interface:MutableCharListRandomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Randomas the source of randomness.- Specified by:
shuffleThisin interfaceMutableCharList
-
shuffleThis
public MutableCharList shuffleThis(java.util.Random rnd)
Description copied from interface:MutableCharListRandomly 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 interfaceMutableCharList
-
binarySearch
public int binarySearch(char value)
- Specified by:
binarySearchin interfaceCharList
-
dotProduct
public long dotProduct(CharList list)
- Specified by:
dotProductin interfaceCharList
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:CharListFollows the same general contract asList.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:CharListFollows the same general contract asList.hashCode().
-
asLazy
public LazyCharIterable asLazy()
Description copied from interface:CharIterableReturns a LazyCharIterable adapter wrapping the source CharIterable.- Specified by:
asLazyin interfaceCharIterable- Overrides:
asLazyin classAbstractSynchronizedCharCollection
-
asUnmodifiable
public MutableCharList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableCharCollection- Specified by:
asUnmodifiablein interfaceMutableCharList- Overrides:
asUnmodifiablein classAbstractSynchronizedCharCollection
-
asSynchronized
public MutableCharList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableCharCollection- Specified by:
asSynchronizedin interfaceMutableCharList- Overrides:
asSynchronizedin classAbstractSynchronizedCharCollection
-
toImmutable
public ImmutableCharList toImmutable()
Description copied from interface:MutableCharListReturns an immutable copy of this list.- Specified by:
toImmutablein interfaceCharList- Specified by:
toImmutablein interfaceMutableCharCollection- Specified by:
toImmutablein interfaceMutableCharList- Overrides:
toImmutablein classAbstractSynchronizedCharCollection
-
newEmpty
public MutableCharList newEmpty()
Description copied from interface:MutableCharListCreates a new empty mutable version of the same List type.- Specified by:
newEmptyin interfaceMutableCharCollection- Specified by:
newEmptyin interfaceMutableCharList- Since:
- 9.2.
-
reverseThis
public MutableCharList reverseThis()
- Specified by:
reverseThisin interfaceMutableCharList
-
toReversed
public MutableCharList toReversed()
- Specified by:
toReversedin interfaceCharList- Specified by:
toReversedin interfaceMutableCharList- Specified by:
toReversedin interfaceReversibleCharIterable
-
asReversed
public LazyCharIterable asReversed()
- Specified by:
asReversedin interfaceReversibleCharIterable
-
forEachInBoth
public void forEachInBoth(CharList other, CharCharProcedure procedure)
Description copied from interface:CharListThis method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBothin interfaceCharList
-
forEachWithIndex
public void forEachWithIndex(CharIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedCharIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedCharIterable- Specified by:
injectIntoWithIndexin interfaceReversibleCharIterable
-
distinct
public MutableCharList distinct()
- Specified by:
distinctin interfaceCharList- Specified by:
distinctin interfaceMutableCharList- Specified by:
distinctin interfaceReversibleCharIterable- Since:
- 6.0.
-
subList
public MutableCharList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceCharList- Specified by:
subListin interfaceMutableCharList- See Also:
List.subList(int fromIndex, int toIndex)
-
zipChar
public MutableList<CharCharPair> zipChar(CharIterable iterable)
Description copied from interface:MutableCharListReturns aMutableListformed from thisMutableCharListand anotherCharListby combining corresponding elements in pairs. If one of the twoCharLists is longer than the other, its remaining elements are ignored.- Specified by:
zipCharin interfaceCharList- Specified by:
zipCharin interfaceMutableCharList- Since:
- 9.1.
-
zip
public <T> MutableList<CharObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableCharListReturns aMutableListformed from thisMutableCharListand 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 interfaceCharList- Specified by:
zipin 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:
selectWithIndexin interfaceCharList- Specified by:
selectWithIndexin interfaceMutableCharList- Specified by:
selectWithIndexin interfaceOrderedCharIterable- Specified by:
selectWithIndexin 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:
selectWithIndexin 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:
rejectWithIndexin interfaceCharList- Specified by:
rejectWithIndexin interfaceMutableCharList- Specified by:
rejectWithIndexin interfaceOrderedCharIterable- Specified by:
rejectWithIndexin 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:
rejectWithIndexin 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:
collectWithIndexin interfaceCharList- Specified by:
collectWithIndexin interfaceMutableCharList- Specified by:
collectWithIndexin interfaceOrderedCharIterable- Specified by:
collectWithIndexin 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:
collectWithIndexin interfaceOrderedCharIterable- Since:
- 9.1.
-
toStack
public MutableCharStack toStack()
Description copied from interface:OrderedCharIterableConverts the collection to a CharStack.- Specified by:
toStackin interfaceOrderedCharIterable
-
-