trait AttributeMap extends AnyRef
An immutable map where a key is the tuple (String,T)
for a fixed type T
and can only be associated with values of type T
.
It is therefore possible for this map to contain mappings for keys with the same label but different types.
Excluding this possibility is the responsibility of the client if desired.
- Alphabetic
- By Inheritance
- AttributeMap
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
++(o: AttributeMap): AttributeMap
Combines the mappings in
o
with the mappings in this map, with mappings ino
taking precedence over existing mappings. -
abstract
def
++(o: Iterable[AttributeEntry[_]]): AttributeMap
Adds the mappings in
o
to this map, with mappings ino
taking precedence over existing mappings. -
abstract
def
apply[T](k: AttributeKey[T]): T
Gets the value of type
T
associated with the keyk
.Gets the value of type
T
associated with the keyk
. If a key with the same label but different type is defined, this method will fail. -
abstract
def
contains[T](k: AttributeKey[T]): Boolean
Returns true if this map contains a mapping for
k
.Returns true if this map contains a mapping for
k
. If a key with the same label but a different type is defined in this map, this method will returnfalse
. -
abstract
def
entries: Iterable[AttributeEntry[_]]
All mappings in this map.
All mappings in this map. The AttributeEntry type preserves the typesafety of mappings, although the specific types are unknown.
-
abstract
def
get[T](k: AttributeKey[T]): Option[T]
Gets the value of type
T
associated with the keyk
orNone
if no value is associated.Gets the value of type
T
associated with the keyk
orNone
if no value is associated. If a key with the same label but a different type is defined, this method will returnNone
. -
abstract
def
isEmpty: Boolean
true
if there are no mappings in this map,false
if there are. -
abstract
def
keys: Iterable[AttributeKey[_]]
All keys with defined mappings.
All keys with defined mappings. There may be multiple keys with the same
label
, but different types. -
abstract
def
put[T](k: AttributeKey[T], value: T): AttributeMap
Adds the mapping
k -> value
to this map, replacing any existing mapping fork
.Adds the mapping
k -> value
to this map, replacing any existing mapping fork
. Any mappings for keys with the same label but different types are unaffected. -
abstract
def
remove[T](k: AttributeKey[T]): AttributeMap
Returns this map without the mapping for
k
.Returns this map without the mapping for
k
. This method will not remove a mapping for a key with the same label but a different type.