Fix doc wording around covariance/invariance
This commit is contained in:
@@ -8,7 +8,7 @@ package kotlin.collections
|
||||
/**
|
||||
* 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.
|
||||
* @param E the type of elements contained in the collection. The collection is invariant in its element type.
|
||||
*/
|
||||
public actual abstract class AbstractMutableCollection<E> protected actual constructor(): MutableCollection<E>, AbstractCollection<E>() {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ package kotlin.collections
|
||||
/**
|
||||
* Provides a skeletal implementation of the [MutableList] interface.
|
||||
*
|
||||
* @param E the type of elements contained in the list. The list is invariant on its element type.
|
||||
* @param E the type of elements contained in the list. The list is invariant in its element type.
|
||||
*/
|
||||
public actual abstract class AbstractMutableList<E> protected actual constructor() : AbstractMutableCollection<E>(), MutableList<E> {
|
||||
protected var modCount: Int = 0
|
||||
|
||||
@@ -5,8 +5,8 @@ package kotlin.collections
|
||||
*
|
||||
* The implementor is required to implement [entries] property, which should return mutable set of map entries, and [put] function.
|
||||
*
|
||||
* @param K the type of map keys. The map is invariant on its key type.
|
||||
* @param V the type of map values. The map is invariant on its value type.
|
||||
* @param K the type of map keys. The map is invariant in its key type.
|
||||
* @param V the type of map values. The map is invariant in its value type.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public actual abstract class AbstractMutableMap<K, V> protected actual constructor() : AbstractMap<K, V>(), MutableMap<K, V> {
|
||||
|
||||
@@ -3,7 +3,7 @@ package kotlin.collections
|
||||
/**
|
||||
* Provides a skeletal implementation of the [MutableSet] interface.
|
||||
*
|
||||
* @param E the type of elements contained in the set. The set is invariant on its element type.
|
||||
* @param E the type of elements contained in the set. The set is invariant in its element type.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public actual abstract class AbstractMutableSet<E> protected actual constructor() : AbstractMutableCollection<E>(), MutableSet<E> {
|
||||
|
||||
@@ -8,7 +8,7 @@ package kotlin.collections
|
||||
/**
|
||||
* A generic collection of elements. Methods in this interface support only read-only access to the collection;
|
||||
* read/write access is supported through the [MutableCollection] interface.
|
||||
* @param E the type of elements contained in the collection. The collection is covariant on its element type.
|
||||
* @param E the type of elements contained in the collection. The collection is covariant in its element type.
|
||||
*/
|
||||
public interface Collection<out E> : Iterable<E> {
|
||||
// Query Operations
|
||||
@@ -38,7 +38,7 @@ public interface Collection<out E> : Iterable<E> {
|
||||
/**
|
||||
* A generic collection of elements that supports adding and removing elements.
|
||||
*
|
||||
* @param E the type of elements contained in the collection. The mutable collection is invariant on its element type.
|
||||
* @param E the type of elements contained in the collection. The mutable collection is invariant in its element type.
|
||||
*/
|
||||
public interface MutableCollection<E> : Collection<E>, MutableIterable<E> {
|
||||
// Query Operations
|
||||
|
||||
@@ -19,7 +19,7 @@ internal actual fun <T> Array<out T>.copyToArrayOfAny(isVarargs: Boolean): Array
|
||||
/**
|
||||
* Classes that inherit from this interface can be represented as a sequence of elements that can
|
||||
* be iterated over.
|
||||
* @param T the type of element being iterated over. The iterator is covariant on its element type.
|
||||
* @param T the type of element being iterated over. The iterator is covariant in its element type.
|
||||
*/
|
||||
public interface Iterable<out T> {
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ public interface Iterable<out T> {
|
||||
/**
|
||||
* Classes that inherit from this interface can be represented as a sequence of elements that can
|
||||
* be iterated over and that supports removing elements during iteration.
|
||||
* @param T the type of element being iterated over. The mutable iterator is invariant on its element type.
|
||||
* @param T the type of element being iterated over. The mutable iterator is invariant in its element type.
|
||||
*/
|
||||
public interface MutableIterable<out T> : Iterable<T> {
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ package kotlin.collections
|
||||
/**
|
||||
* A generic ordered collection of elements. Methods in this interface support only read-only access to the list;
|
||||
* read/write access is supported through the [MutableList] interface.
|
||||
* @param E the type of elements contained in the list. The list is covariant on its element type.
|
||||
* @param E the type of elements contained in the list. The list is covariant in its element type.
|
||||
*/
|
||||
public interface List<out E> : Collection<E> {
|
||||
// Query Operations
|
||||
@@ -62,7 +62,7 @@ public interface List<out E> : Collection<E> {
|
||||
|
||||
/**
|
||||
* A generic ordered collection of elements that supports adding and removing elements.
|
||||
* @param E the type of elements contained in the list. The mutable list is invariant on its element type.
|
||||
* @param E the type of elements contained in the list. The mutable list is invariant in its element type.
|
||||
*/
|
||||
public interface MutableList<E> : List<E>, MutableCollection<E> {
|
||||
// Modification Operations
|
||||
|
||||
@@ -10,9 +10,9 @@ package kotlin.collections
|
||||
* the value corresponding to each key. Map keys are unique; the map holds only one value for each key.
|
||||
* Methods in this interface support only read-only access to the map; read-write access is supported through
|
||||
* the [MutableMap] interface.
|
||||
* @param K the type of map keys. The map is invariant on its key type, as it
|
||||
* @param K the type of map keys. The map is invariant in its key type, as it
|
||||
* can accept key as a parameter (of [containsKey] for example) and return it in [keys] set.
|
||||
* @param V the type of map values. The map is covariant on its value type.
|
||||
* @param V the type of map values. The map is covariant in its value type.
|
||||
*/
|
||||
public interface Map<K, out V> {
|
||||
// Query Operations
|
||||
@@ -76,8 +76,8 @@ public interface Map<K, out V> {
|
||||
/**
|
||||
* A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving
|
||||
* the value corresponding to each key. Map keys are unique; the map holds only one value for each key.
|
||||
* @param K the type of map keys. The map is invariant on its key type.
|
||||
* @param V the type of map values. The mutable map is invariant on its value type.
|
||||
* @param K the type of map keys. The map is invariant in its key type.
|
||||
* @param V the type of map values. The mutable map is invariant in its value type.
|
||||
*/
|
||||
public interface MutableMap<K, V> : Map<K, V> {
|
||||
// Modification Operations
|
||||
|
||||
@@ -9,7 +9,7 @@ package kotlin.collections
|
||||
* A generic unordered collection of elements that does not support duplicate elements.
|
||||
* Methods in this interface support only read-only access to the set;
|
||||
* read/write access is supported through the [MutableSet] interface.
|
||||
* @param E the type of elements contained in the set. The set is covariant on its element type.
|
||||
* @param E the type of elements contained in the set. The set is covariant in its element type.
|
||||
*/
|
||||
public interface Set<out E> : Collection<E> {
|
||||
// Query Operations
|
||||
@@ -26,7 +26,7 @@ public interface Set<out E> : Collection<E> {
|
||||
/**
|
||||
* A generic unordered collection of elements that does not support duplicate elements, and supports
|
||||
* adding and removing elements.
|
||||
* @param E the type of elements contained in the set. The mutable set is invariant on its element type.
|
||||
* @param E the type of elements contained in the set. The mutable set is invariant in its element type.
|
||||
*/
|
||||
public interface MutableSet<E> : Set<E>, MutableCollection<E> {
|
||||
// Query Operations
|
||||
|
||||
Reference in New Issue
Block a user