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

kotlin.collections.AbstractMutableCollection.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0-RC1
Show newest version
/*
 * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
 * that can be found in the license/LICENSE.txt file.
 */

package kotlin.collections

import java.util.AbstractCollection

/**
 * Provides a skeletal implementation of the [MutableCollection] interface.
 *
 * @param E the type of elements contained in the collection. The collection is invariant on its element type.
 */
@SinceKotlin("1.1")
public abstract class AbstractMutableCollection protected constructor() : MutableCollection, AbstractCollection() {
    /**
     * Adds the specified element to the collection.
     *
     * This method is redeclared as abstract, because it's not implemented in the base class,
     * so it must be always overridden in the concrete mutable collection implementation.
     *
     * @return `true` if the element has been added, `false` if the collection does not support duplicates
     * and the element is already contained in the collection.
     */
    abstract override fun add(element: E): Boolean
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy