Skip to content

Instantly share code, notes, and snippets.

@skroll
Created November 4, 2015 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skroll/d35cee8497a1ccc392a9 to your computer and use it in GitHub Desktop.
Save skroll/d35cee8497a1ccc392a9 to your computer and use it in GitHub Desktop.
public abstract class AbstractFoo<K, V> : kotlin.Map<K, V> {
override operator fun get(key: K): V? {
println("AbstractFoo")
return null
}
override val size: Int
get() = throw UnsupportedOperationException()
override fun isEmpty(): Boolean {
throw UnsupportedOperationException()
}
override fun containsKey(key: K): Boolean {
throw UnsupportedOperationException()
}
override fun containsValue(value: V): Boolean {
throw UnsupportedOperationException()
}
override val keys: Set<K>
get() = throw UnsupportedOperationException()
override val values: Collection<V>
get() = throw UnsupportedOperationException()
override val entries: Set<Map.Entry<K, V>>
get() = throw UnsupportedOperationException()
}
public class IntFoo<E> : AbstractFoo<Int, E>() {
override operator fun get(key: Int): E? {
println("IntFoo")
return null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment