Remove EmptyMutableIterator
This commit is contained in:
parent
0b316fe0fc
commit
fd7619b144
@ -1,44 +0,0 @@
|
|||||||
package ru.dbotthepony.mc.otm.core
|
|
||||||
|
|
||||||
object EmptyMutableIterator : MutableIterator<@UnsafeVariance Nothing>, MutableListIterator<@UnsafeVariance Nothing> {
|
|
||||||
override fun hasPrevious(): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun nextIndex(): Int {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun previous(): Nothing {
|
|
||||||
throw NoSuchElementException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun previousIndex(): Int {
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun add(element: Nothing) {
|
|
||||||
throw UnsupportedOperationException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hasNext(): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun next(): Nothing {
|
|
||||||
throw NoSuchElementException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun remove() {
|
|
||||||
throw NoSuchElementException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun set(element: Nothing) {
|
|
||||||
throw UnsupportedOperationException()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("unchecked_cast")
|
|
||||||
fun <T> cast(): MutableListIterator<T> {
|
|
||||||
return this as MutableListIterator<T>
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user