SimpleAttributeHolder

abstract class SimpleAttributeHolder(val attributeMap: MutableMap<Key, Any>) : AttributeHolder(source)

Inheritors

Constructors

Link copied to clipboard
constructor(attributeMap: MutableMap<Key, Any>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun getAttribute(key: Key): Any

Retrieves an attribute with the given key. If no attribute with the given key exists, an exception is thrown.

Link copied to clipboard
open fun getAttributeOrDefault(key: Key, default: Any): Any

Retrieves an attribute with the given key. If no attribute with the given key exists, the default value is returned.

Link copied to clipboard
open override fun getAttributeOrNull(key: Key): Any?

Retrieves an attribute with the given key. If no attribute with the given key exists, null is returned.

Link copied to clipboard
open override fun getAttributes(): Map<Key, Any>

Returns a map of all attributes that are associated with a key which can be modified.

Link copied to clipboard
inline fun <T> AttributeHolder.getAttributeType(key: Key): T

Retrieves an attribute with the given key and casts it to the given type. If the attribute is not of the given type, a ClassCastException is thrown. If no attribute with the given key exists, an exception is thrown.

Link copied to clipboard
inline fun <T> AttributeHolder.getAttributeTypeOrDefault(key: Key, default: T): T

Retrieves an attribute with the given key and casts it to the given type. If the attribute is not of the given type, a ClassCastException is thrown. If no attribute with the given key exists, the default value is returned.

Link copied to clipboard

Retrieves an attribute with the given key and casts it to the given type. If the attribute is not of the given type, a ClassCastException is thrown. If no attribute with the given key exists, null is returned.

Link copied to clipboard
open override fun getKeys(): Set<Key>

Returns a set of all keys that are associated with an attribute.

Link copied to clipboard
open fun hasAttribute(key: Key): Boolean

Whether this cell has an attribute with the given key.

Link copied to clipboard
open override fun removeAttribute(key: Key): Any?

Removes an attribute with the given key. If no attribute with the given key exists, null is returned; otherwise the previous value that was associated with the key is returned.

Link copied to clipboard
open override fun setAttribute(key: Key, value: Any)

Sets an attribute with the given key to the given value. If an attribute with the same key already exists, it will be overwritten.