com.skillw.pouvoir.api.plugin.map.LinkedKeyMap.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
package com.skillw.pouvoir.api.plugin.map
import com.skillw.pouvoir.api.plugin.map.component.Keyable
/**
* Linked key map
*
* @param K
* @param V
* @constructor Create empty Linked key map
*/
open class LinkedKeyMap> : LinkedMap() {
private fun getKey(value: V): K {
return value.key
}
/**
* Register
*
* @param value
*/
open fun register(value: V) {
register(value.key, value)
}
/**
* Remove by value
*
* @param value
*/
fun removeByValue(value: V) {
val key = getKey(value)
key.also { remove(it) }
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy