HDict class abstract
HDict is an immutable map of name/HVal pairs. Use HDictBuilder to construct a HDict instance.
See Project Haystack
Properties
-
entries
→ Iterable<
MapEntry< String, HVal?> > -
The map entries of this.
no setterinherited
- hashCode → int
-
Hash code is based on tags
no setteroverride
- isEmpty → bool
-
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
Returns if size is zero.
no setteroverride
- isNotEmpty → bool
-
Whether there is at least one key/value pair in the map.
no setterinherited
-
keys
→ Iterable<
String> -
The keys of this.
no setterinherited
- length → int
-
The number of key/value pairs in the map.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Returns number of tag name/value pairs
no setter
-
values
→ Iterable<
HVal?> -
The values of this.
no setterinherited
Methods
-
addAll(
Map< String, HVal?> other) → void -
Adds all key/value pairs of
other
to this map.inherited -
addEntries(
Iterable< MapEntry< newEntries) → voidString, HVal?> > -
Adds all key/value pairs of
newEntries
to this map.inherited -
cast<
RK, RV> () → Map< RK, RV> -
Provides a view of this map as having
RK
keys andRV
instances, if necessary.inherited -
clear(
) → void -
Removes all entries from the map.
override
-
compareTo(
Object that) → int -
Returns sort order as negative, 0, or positive.
inherited
-
containsKey(
Object? key) → bool -
Whether this map contains the given
key
.inherited -
containsValue(
Object? value) → bool -
Whether this map contains the given
value
.inherited -
dis(
) → String - Get display string for this entity:
-
forEach(
void action(String key, HVal value)) → void -
Iterates keys and values in keys order and skipping null values.
override
-
get(
String name, {bool checked = true}) → HVal? - Get a tag by name.
-
getBool(
String name, {bool checked = true}) → bool? - /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// Get tag as HBool or raise UnknownNameException or ClassCastException.
-
getDouble(
String name, {bool checked = true}) → double? - Get tag as HNum or raise UnknownNameException or ClassCastException.
-
getInt(
String name, {bool checked = true}) → int? - Get tag as HNum or raise UnknownNameException or ClassCastException.
-
getRef(
String name, {bool checked = true}) → HRef? - Get tag as HRef or raise UnknownNameException or ClassCastException.
-
getStr(
String name, {bool checked = true}) → String? - Get tag as HStr or raise UnknownNameException or ClassCastException.
-
has(
String name) → bool - Returns if the given tag is present.
-
hasTyped<
T> (String name) → bool -
id(
) → HRef? - Get the "id" tag as HRef.
-
map<
K2, V2> (MapEntry< K2, V2> transform(String key, HVal? value)) → Map<K2, V2> -
Returns a new map where all entries of this map are transformed by
the given
convert
function.inherited -
missing(
String name) → bool - Returns if the given tag is not present.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
putIfAbsent(
String key, HVal? ifAbsent()) → HVal? -
Look up the value of
key
, or add a new entry if it isn't there.inherited -
remove(
Object? key) → HVal -
Removes
key
and its associated value, if present, from the map.override -
removeWhere(
bool test(String key, HVal? value)) → void -
Removes all entries of this map that satisfy the given
test
.inherited -
toJson(
) → String -
Encodes value to json format
override
-
toString(
) → String -
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
String format is always "toZinc"
override
-
toZinc(
) → String -
Encodes value to zinc format
override
-
update(
String key, HVal? update(HVal? value), {HVal? ifAbsent()?}) → HVal? -
Updates the value for the provided
key
.inherited -
updateAll(
HVal? update(String key, HVal? value)) → void -
Updates all values.
inherited
Operators
-
operator ==(
Object other) → bool -
Equality is tags
override
-
operator [](
Object? key) → HVal? -
The value for the given
key
, ornull
ifkey
is not in the map.inherited -
operator []=(
String key, HVal? value) → void -
Associates the
key
with the givenvalue
.override