All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.collections.impl.collection.mutable.AbstractSynchronizedMutableCollection Maven / Gradle / Ivy

Go to download

Builds the commons-text. Requires eclipse-collections-api be built first and be excluded from any other poms requiring it.

There is a newer version: 11.1.0-r13
Show newest version
/*
 * Copyright (c) 2021 Goldman Sachs and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v. 1.0 which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 */

package org.eclipse.collections.impl.collection.mutable;

import java.util.Collection;

import org.eclipse.collections.api.bag.MutableBag;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function0;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.function.Function3;
import org.eclipse.collections.api.block.function.primitive.BooleanFunction;
import org.eclipse.collections.api.block.function.primitive.ByteFunction;
import org.eclipse.collections.api.block.function.primitive.CharFunction;
import org.eclipse.collections.api.block.function.primitive.DoubleFunction;
import org.eclipse.collections.api.block.function.primitive.FloatFunction;
import org.eclipse.collections.api.block.function.primitive.IntFunction;
import org.eclipse.collections.api.block.function.primitive.LongFunction;
import org.eclipse.collections.api.block.function.primitive.ShortFunction;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure2;
import org.eclipse.collections.api.collection.MutableCollection;
import org.eclipse.collections.api.collection.primitive.MutableBooleanCollection;
import org.eclipse.collections.api.collection.primitive.MutableByteCollection;
import org.eclipse.collections.api.collection.primitive.MutableCharCollection;
import org.eclipse.collections.api.collection.primitive.MutableDoubleCollection;
import org.eclipse.collections.api.collection.primitive.MutableFloatCollection;
import org.eclipse.collections.api.collection.primitive.MutableIntCollection;
import org.eclipse.collections.api.collection.primitive.MutableLongCollection;
import org.eclipse.collections.api.collection.primitive.MutableShortCollection;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.map.primitive.MutableObjectDoubleMap;
import org.eclipse.collections.api.map.primitive.MutableObjectLongMap;
import org.eclipse.collections.api.multimap.MutableMultimap;
import org.eclipse.collections.api.partition.PartitionMutableCollection;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.api.tuple.Twin;
import org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable;

public abstract class AbstractSynchronizedMutableCollection
        extends AbstractSynchronizedRichIterable implements MutableCollection
{
    protected AbstractSynchronizedMutableCollection(MutableCollection delegate)
    {
        this(delegate, null);
    }

    protected AbstractSynchronizedMutableCollection(MutableCollection delegate, Object lock)
    {
        super(delegate, lock);
    }

    @Override
    protected MutableCollection getDelegate()
    {
        return (MutableCollection) super.getDelegate();
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableCollection select(Predicate predicate)
    {
        return (MutableCollection) super.select(predicate);
    }

    /**
     * @since 9.0
     */
    @Override
    public  MutableCollection selectInstancesOf(Class clazz)
    {
        return (MutableCollection) super.selectInstancesOf(clazz);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableCollection reject(Predicate predicate)
    {
        return (MutableCollection) super.reject(predicate);
    }

    /**
     * @since 9.0
     */
    @Override
    public  MutableCollection flatCollect(Function> function)
    {
        return (MutableCollection) super.flatCollect(function);
    }

    /**
     * @since 9.0
     */
    @Override
    public  MutableCollection collect(Function function)
    {
        return (MutableCollection) super.collect(function);
    }

    /**
     * @since 9.0
     */
    @Override
    public  MutableCollection collectWith(Function2 function, P parameter)
    {
        return (MutableCollection) super.collectWith(function, parameter);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableBooleanCollection collectBoolean(BooleanFunction booleanFunction)
    {
        return (MutableBooleanCollection) super.collectBoolean(booleanFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableByteCollection collectByte(ByteFunction byteFunction)
    {
        return (MutableByteCollection) super.collectByte(byteFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableCharCollection collectChar(CharFunction charFunction)
    {
        return (MutableCharCollection) super.collectChar(charFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableDoubleCollection collectDouble(DoubleFunction doubleFunction)
    {
        return (MutableDoubleCollection) super.collectDouble(doubleFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableFloatCollection collectFloat(FloatFunction floatFunction)
    {
        return (MutableFloatCollection) super.collectFloat(floatFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableIntCollection collectInt(IntFunction intFunction)
    {
        return (MutableIntCollection) super.collectInt(intFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableLongCollection collectLong(LongFunction longFunction)
    {
        return (MutableLongCollection) super.collectLong(longFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public MutableShortCollection collectShort(ShortFunction shortFunction)
    {
        return (MutableShortCollection) super.collectShort(shortFunction);
    }

    /**
     * @since 9.0
     */
    @Override
    public 

MutableCollection selectWith(Predicate2 predicate, P parameter) { return (MutableCollection) super.selectWith(predicate, parameter); } /** * @since 9.0 */ @Override public

MutableCollection rejectWith(Predicate2 predicate, P parameter) { return (MutableCollection) super.rejectWith(predicate, parameter); } /** * @since 9.0 */ @Override public MutableCollection collectIf(Predicate predicate, Function function) { return (MutableCollection) super.collectIf(predicate, function); } /** * @since 9.0 */ @Override public MutableCollection tap(Procedure procedure) { return (MutableCollection) super.tap(procedure); } /** * @since 9.0 */ @Override public MutableCollection> zip(Iterable that) { return (MutableCollection>) super.zip(that); } /** * @since 9.0 */ @Override public MutableCollection> zipWithIndex() { return (MutableCollection>) super.zipWithIndex(); } /** * @since 9.0 */ @Override public MutableMultimap groupBy(Function function) { return (MutableMultimap) super.groupBy(function); } /** * @since 9.0 */ @Override public MutableMultimap groupByEach(Function> function) { return (MutableMultimap) super.groupByEach(function); } /** * @since 9.0 */ @Override public MutableBag countBy(Function function) { return (MutableBag) super.countBy(function); } /** * @since 9.0 */ @Override public MutableBag countByWith(Function2 function, P parameter) { return (MutableBag) super.countByWith(function, parameter); } /** * @since 10.0.0 */ @Override public MutableBag countByEach(Function> function) { return (MutableBag) super.countByEach(function); } /** * @since 9.0 */ @Override public PartitionMutableCollection partition(Predicate predicate) { return (PartitionMutableCollection) super.partition(predicate); } /** * @since 9.0 */ @Override public

PartitionMutableCollection partitionWith(Predicate2 predicate, P parameter) { return (PartitionMutableCollection) super.partitionWith(predicate, parameter); } @Override public boolean add(T o) { synchronized (this.getLock()) { return this.getDelegate().add(o); } } @Override public boolean remove(Object o) { synchronized (this.getLock()) { return this.getDelegate().remove(o); } } @Override public boolean addAll(Collection coll) { synchronized (this.getLock()) { return this.getDelegate().addAll(coll); } } @Override public boolean removeAll(Collection coll) { synchronized (this.getLock()) { return this.getDelegate().removeAll(coll); } } @Override public boolean retainAll(Collection coll) { synchronized (this.getLock()) { return this.getDelegate().retainAll(coll); } } @Override public void clear() { synchronized (this.getLock()) { this.getDelegate().clear(); } } @Override public boolean removeIf(Predicate predicate) { synchronized (this.lock) { return this.getDelegate().removeIf(predicate); } } @Override public

boolean removeIfWith(Predicate2 predicate, P parameter) { synchronized (this.lock) { return this.getDelegate().removeIfWith(predicate, parameter); } } @Override public boolean addAllIterable(Iterable iterable) { synchronized (this.getLock()) { return this.getDelegate().addAllIterable(iterable); } } @Override public boolean removeAllIterable(Iterable iterable) { synchronized (this.getLock()) { return this.getDelegate().removeAllIterable(iterable); } } @Override public boolean retainAllIterable(Iterable iterable) { synchronized (this.getLock()) { return this.getDelegate().retainAllIterable(iterable); } } @Override public

Twin> selectAndRejectWith( Predicate2 predicate, P parameter) { synchronized (this.lock) { return this.getDelegate().selectAndRejectWith(predicate, parameter); } } @Override public IV injectIntoWith( IV injectValue, Function3 function, P parameter) { synchronized (this.lock) { return this.getDelegate().injectIntoWith(injectValue, function, parameter); } } @Override public MutableMap groupByUniqueKey(Function function) { synchronized (this.lock) { return this.getDelegate().groupByUniqueKey(function); } } @Override public MutableMap aggregateInPlaceBy( Function groupBy, Function0 zeroValueFactory, Procedure2 mutatingAggregator) { synchronized (this.getLock()) { return this.getDelegate().aggregateInPlaceBy(groupBy, zeroValueFactory, mutatingAggregator); } } @Override public MutableMap aggregateBy( Function groupBy, Function0 zeroValueFactory, Function2 nonMutatingAggregator) { synchronized (this.getLock()) { return this.getDelegate().aggregateBy(groupBy, zeroValueFactory, nonMutatingAggregator); } } @Override public MutableObjectLongMap sumByInt(Function groupBy, IntFunction function) { synchronized (this.lock) { return this.getDelegate().sumByInt(groupBy, function); } } @Override public MutableObjectDoubleMap sumByFloat(Function groupBy, FloatFunction function) { synchronized (this.lock) { return this.getDelegate().sumByFloat(groupBy, function); } } @Override public MutableObjectLongMap sumByLong(Function groupBy, LongFunction function) { synchronized (this.lock) { return this.getDelegate().sumByLong(groupBy, function); } } @Override public MutableObjectDoubleMap sumByDouble(Function groupBy, DoubleFunction function) { synchronized (this.lock) { return this.getDelegate().sumByDouble(groupBy, function); } } }