HTStruct class

A prototype based dynamic object. You can define and delete members in runtime. Use prototype to create and extends from other object. Can be named or anonymous. Unlike class, you have to use 'this' to access struct member within its own methods

Mixed in types

Constructors

HTStruct(HTInterpreter interpreter, {String? id, HTStruct? prototype, bool isRootPrototype = false, Map<String, dynamic>? fields, HTNamespace? closure})

Properties

closure HTNamespace?
final
declaration HTNamedStruct?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String?
final
interpreter HTInterpreter
final
isEmpty bool
Whether there is no key/value pair in the map.
no setter
isNotEmpty bool
Whether there is at least one key/value pair in the map.
no setter
isRootPrototype bool
final
keys Iterable<String>
no setter
length int
The number of key/value pairs in the map.
no setter
namespace HTNamespace
latefinal
prototype HTStruct?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Iterable
no setter
valueType HTStructuralType
no setteroverride

Methods

assign(HTStruct other) → void
clone() HTStruct
contains(String? varName) bool
Check if this struct has the key in its own _fields or its prototypes' _fields
override
containsKey(String? varName) bool
Check if this struct has the key in its own _fields
define(String id, dynamic value, {bool override = false, bool throws = true}) → void
delete(String id) → void
import(HTStruct other, {bool clone = false}) → void
memberGet(dynamic varName, {String? from, bool isRecursivelyGet = false}) → dynamic
isSelf means wether this is called by the struct itself, or a recursive one
override
memberSet(dynamic varName, dynamic varValue, {String? from, bool defineIfAbsent = true, bool recursive = true}) bool
Assign a value to a member by the varName, in the form of
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subGet(dynamic varName, {String? from}) → dynamic
Fetch a member by the varName, in the form of
override
subSet(dynamic varName, dynamic varValue, {String? from}) → void
Assign a value to a member by the varName, in the form of
override
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](dynamic key) → dynamic
operator []=(dynamic key, dynamic value) → void

Static Properties

structLiteralIndex int
getter/setter pair