Remove EmptyMutableIterator

This commit is contained in:
DBotThePony 2023-01-14 10:14:51 +07:00
parent 0b316fe0fc
commit fd7619b144
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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>
}
}