Stdlib rename: List.indexOf(T), List.lastIndexOf(T), MutableCollection.removeAll(Collection<T>), MutableCollection.retainAll(Collection<T>)

This commit is contained in:
Mikhail Glukhikh
2015-10-12 15:53:22 +03:00
parent ed5ba01e85
commit 78cfeb0d7d
49 changed files with 244 additions and 226 deletions
+2 -2
View File
@@ -17,11 +17,11 @@ class StrList : List<String?> {
throw UnsupportedOperationException()
}
override fun indexOf(o: Any?): Int {
override fun indexOf(o: String?): Int {
throw UnsupportedOperationException()
}
override fun lastIndexOf(o: Any?): Int {
override fun lastIndexOf(o: String?): Int {
throw UnsupportedOperationException()
}
+2 -2
View File
@@ -5,8 +5,8 @@ class MyList<T>: List<T> {
override fun iterator(): Iterator<T> = throw Error()
override fun containsAll(c: Collection<T>): Boolean = false
override fun get(index: Int): T = throw IndexOutOfBoundsException()
override fun indexOf(o: Any?): Int = -1
override fun lastIndexOf(o: Any?): Int = -1
override fun indexOf(o: T): Int = -1
override fun lastIndexOf(o: T): Int = -1
override fun listIterator(): ListIterator<T> = throw Error()
override fun listIterator(index: Int): ListIterator<T> = throw Error()
override fun subList(fromIndex: Int, toIndex: Int): List<T> = this
@@ -5,8 +5,8 @@ class MyList<T>(val v: T): List<T> {
override fun iterator(): Iterator<T> = throw Error()
override fun containsAll(c: Collection<T>): Boolean = false
override fun get(index: Int): T = v
override fun indexOf(o: Any?): Int = -1
override fun lastIndexOf(o: Any?): Int = -1
override fun indexOf(o: T): Int = -1
override fun lastIndexOf(o: T): Int = -1
override fun listIterator(): ListIterator<T> = throw Error()
override fun listIterator(index: Int): ListIterator<T> = throw Error()
override fun subList(fromIndex: Int, toIndex: Int): List<T> = throw Error()
@@ -17,8 +17,8 @@ class MyList<T>(val v: T): List<T> {
public fun remove(o: T): Boolean = true
public fun addAll(c: Collection<T>): Boolean = true
public fun addAll(index: Int, c: Collection<T>): Boolean = true
public fun removeAll(c: Collection<Any?>): Boolean = true
public fun retainAll(c: Collection<Any?>): Boolean = true
public fun removeAll(c: Collection<T>): Boolean = true
public fun retainAll(c: Collection<T>): Boolean = true
public fun clear() {}
public fun set(index: Int, element: T): T = element
public fun add(index: Int, element: T) {}
@@ -3,8 +3,8 @@ open class Super<T>(val v: T) {
public fun remove(o: T): Boolean = true
public fun addAll(c: Collection<T>): Boolean = true
public fun addAll(index: Int, c: Collection<T>): Boolean = true
public fun removeAll(c: Collection<Any?>): Boolean = true
public fun retainAll(c: Collection<Any?>): Boolean = true
public fun removeAll(c: Collection<T>): Boolean = true
public fun retainAll(c: Collection<T>): Boolean = true
public fun clear() {}
public fun set(index: Int, element: T): T = element
public fun add(index: Int, element: T) {}
@@ -18,8 +18,8 @@ class MyList<T>(v: T): Super<T>(v), List<T> {
override fun iterator(): Iterator<T> = throw Error()
override fun containsAll(c: Collection<T>): Boolean = false
override fun get(index: Int): T = v
override fun indexOf(o: Any?): Int = -1
override fun lastIndexOf(o: Any?): Int = -1
override fun indexOf(o: T): Int = -1
override fun lastIndexOf(o: T): Int = -1
override fun listIterator(): ListIterator<T> = throw Error()
override fun listIterator(index: Int): ListIterator<T> = throw Error()
override fun subList(fromIndex: Int, toIndex: Int): List<T> = throw Error()
@@ -5,8 +5,8 @@ class MyList: List<String> {
override fun iterator(): Iterator<String> = throw Error()
override fun containsAll(c: Collection<String>): Boolean = false
override fun get(index: Int): String = throw IndexOutOfBoundsException()
override fun indexOf(o: Any?): Int = -1
override fun lastIndexOf(o: Any?): Int = -1
override fun indexOf(o: String): Int = -1
override fun lastIndexOf(o: String): Int = -1
override fun listIterator(): ListIterator<String> = throw Error()
override fun listIterator(index: Int): ListIterator<String> = throw Error()
override fun subList(fromIndex: Int, toIndex: Int): List<String> = this
@@ -9,8 +9,8 @@ class C : Addable, List<String> {
override fun iterator(): Iterator<String> = null!!
override fun containsAll(c: Collection<String>): Boolean = null!!
override fun get(index: Int): String = null!!
override fun indexOf(o: Any?): Int = null!!
override fun lastIndexOf(o: Any?): Int = null!!
override fun indexOf(o: String): Int = null!!
override fun lastIndexOf(o: String): Int = null!!
override fun listIterator(): ListIterator<String> = null!!
override fun listIterator(index: Int): ListIterator<String> = null!!
override fun subList(fromIndex: Int, toIndex: Int): List<String> = null!!
@@ -30,11 +30,11 @@ class A1 : MutableCollection<String> {
throw UnsupportedOperationException()
}
override fun removeAll(c: Collection<Any?>): Boolean {
override fun removeAll(c: Collection<String>): Boolean {
throw UnsupportedOperationException()
}
override fun retainAll(c: Collection<Any?>): Boolean {
override fun retainAll(c: Collection<String>): Boolean {
throw UnsupportedOperationException()
}