@haxall/haxall
    Preparing search index...

    Class ObixObj

    ObixObj models an obix:obj element.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Add a child object. Throw ArgErr if this child is already parented or has a duplicate name. Return this.

      Parameters

      Returns this

    • Remove all children objects. Return this.

      Returns this

    • Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object:

      this < that   =>  <0
      this == that => 0
      this > that => >0

      This method may also be accessed via the < <= <=> >= and > shortcut operators. If not overridden the default implementation compares the toStr representations. Also see docLang.

      Examples:

      3.compare(8)  =>  -1
      8.compare(3) => 1
      8.compare(8) => 0
      3 <=> 8 => -1 // shortcut for 3.compare(8)

      Parameters

      Returns number

    • The list of contract URIs this object implemented as specified by is attribute.

      Returns Contract

    • The list of contract URIs this object implemented as specified by is attribute.

      Parameters

      Returns void

    • Localized human readable string summary of the object.

      Returns string

    • Localized human readable string summary of the object.

      Parameters

      • it: string

      Returns void

    • Localized human readable version of the name attribute.

      Returns string

    • Localized human readable version of the name attribute.

      Parameters

      • it: string

      Returns void

    • Iterate each of the children objects.

      Parameters

      Returns void

    • The XML element name to use for this object. If not one of the valid oBIX element names then throw ArgErr. Valid element names are:

      obj, bool, int, real, str, enum, uri, abstime,
      reltime, date, time, list, op, feed, ref, err

      Returns string

    • The XML element name to use for this object. If not one of the valid oBIX element names then throw ArgErr. Valid element names are:

      obj, bool, int, real, str, enum, uri, abstime,
      reltime, date, time, list, op, feed, ref, err

      Parameters

      • it: string

      Returns void

    • Compare this object to the specified for equality. This method may be accessed via the == and != shortcut operators. If not overridden the default implementation compares for reference equality using the === operator. If this method is overridden, then hash() must also be overridden such that any two objects which return true for equals() must return the same value for hash(). This method must accept null and return false.

      Parameters

      Returns boolean

    • Get the first child returned by list or null.

      Returns ObixObj

    • Get a child by name. If not found and checked is true then throw NameErr, otherwise null.

      Parameters

      • name: string
      • Optionalchecked: boolean

      Returns ObixObj

    • Return if there is child object by the specified name.

      Parameters

      • name: string

      Returns boolean

    • Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.

      Returns number

    • URI of this object. The root object of a document must have an absolute URI, other objects may have a URI relative to the document root. See normalizedHref to get this href normalized against the root object.

      Returns Uri

    • URI of this object. The root object of a document must have an absolute URI, other objects may have a URI relative to the document root. See normalizedHref to get this href normalized against the root object.

      Parameters

      Returns void

    • Reference to the graphical icon.

      Returns Uri

    • Reference to the graphical icon.

      Parameters

      Returns void

    • The in contract for operations and feeds.

      Returns Contract

    • The in contract for operations and feeds.

      Parameters

      Returns void

    • Return is size is zero.

      Returns boolean

    • Return if this Obj is immutable and safe to share between threads:

      • an instance of a const class
      • the result of toImmutable on List, Map, or Buf
      • a Func object may or may not be immutable - see sys::Func.
      • other instances are assumed mutable and return false

      Returns boolean

    • The null flag indicates the absense of a value.

      Returns boolean

    • The null flag indicates the absense of a value.

      Parameters

      • it: boolean

      Returns void

    • Get the last child returned by list or null.

      Returns ObixObj

    • Get a readonly list of the children objects or empty list if no children. If iterating the children it is more efficient to use each.

      Returns List<ObixObj>

    • Inclusive maximum for value.

      Returns JsObj

    • Inclusive maximum for value.

      Parameters

      Returns void

    • Inclusive minium for value.

      Returns JsObj

    • Inclusive minium for value.

      Parameters

      Returns void

    • Programatic name of the object which defines role of this object in its parent. Throw UnsupportedErr if an attempt is made to set the name once mounted under a parent.

      Returns string

    • Programatic name of the object which defines role of this object in its parent. Throw UnsupportedErr if an attempt is made to set the name once mounted under a parent.

      Parameters

      • it: string

      Returns void

    • Get this objects href normalized against the root object's URI. Return null no href defined.

      Returns Uri

    • The of contract for lists and feeds.

      Returns Contract

    • The of contract for lists and feeds.

      Parameters

      Returns void

    • The out contract for operations.

      Returns Contract

    • The out contract for operations.

      Parameters

      Returns void

    • Parent object or null if unparented.

      Returns ObixObj

    • Parent object or null if unparented.

      Parameters

      Returns void

    • Number of decimal places to use for a real value.

      Returns number

    • Number of decimal places to use for a real value.

      Parameters

      • it: number

      Returns void

    • Reference to the range definition of an enum or bool value.

      Returns Uri

    • Reference to the range definition of an enum or bool value.

      Parameters

      Returns void

    • Remove the specified child object by reference. Throw ArgErr if not my child. Return this

      Parameters

      Returns this

    • Get the root ancestor of this object, or return this if no parent.

      Returns ObixObj

    • Return number of child objects.

      Returns number

    • Status facet indicates quality and state.

      Returns Status

    • Status facet indicates quality and state.

      Parameters

      Returns void

    • Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:

      • if type is const, return this
      • if already an immutable List, Map, Buf, or Func return this
      • if a List, then attempt to perform a deep clone by calling toImmutable on all items
      • if a Map, then attempt to perform a deep clone by calling toImmutable on all values (keys are already immutable)
      • some Funcs can be made immutable - see sys::Func
      • if a Buf create immutable copy, see sys::Buf
      • any other object throws NotImmutableErr

      Returns Readonly<this>

    • Return string representation.

      Returns string

    • If the name maps to a child object, then return that child's value. Otherwise route to Obj.trap.

      Parameters

      Returns JsObj

    • Get the Type instance which represents this object's class. Also seeType.of or Pod.of.

      Returns Type

    • TimeZone facet assocaited with abstime, date, and time objects. This field is automatically updated when val is assigned a DateTime unless its timezone is UTC or starts with "Etc/". After decoding this field is set only if an explicit "tz" attribute was specified.

      Returns TimeZone

    • TimeZone facet assocaited with abstime, date, and time objects. This field is automatically updated when val is assigned a DateTime unless its timezone is UTC or starts with "Etc/". After decoding this field is set only if an explicit "tz" attribute was specified.

      Parameters

      Returns void

    • Unit of measurement for int and real values. We only support units which are predefind in the oBIX unit database and specified using the URI "obix:units/". These units are mapped to the sys::Unit API. If an unknown unit URI is decoded, then it is silently ignored and this field will be null.

      Returns Unit

    • Unit of measurement for int and real values. We only support units which are predefind in the oBIX unit database and specified using the URI "obix:units/". These units are mapped to the sys::Unit API. If an unknown unit URI is decoded, then it is silently ignored and this field will be null.

      Parameters

      Returns void

    • Object value for value object types:

      • obix:bool => sys::Bool
      • obix:int => sys::Int
      • obix:real => sys::Float
      • obix:str => sys::Str
      • obix:enum => sys::Str
      • obix:uri => sys::Uri
      • obix:abstime => sys::DateTime
      • obix:reltime => sys::Duration
      • obix:date => sys::Date
      • obix:time => sys::Time

      If the value is not one of the types listed above, then ArgErr is thrown. If the value is set to non-null, then the elemName is automatically updated.

      Returns JsObj

    • Object value for value object types:

      • obix:bool => sys::Bool
      • obix:int => sys::Int
      • obix:real => sys::Float
      • obix:str => sys::Str
      • obix:enum => sys::Str
      • obix:uri => sys::Uri
      • obix:abstime => sys::DateTime
      • obix:reltime => sys::Duration
      • obix:date => sys::Date
      • obix:time => sys::Time

      If the value is not one of the types listed above, then ArgErr is thrown. If the value is set to non-null, then the elemName is automatically updated.

      Parameters

      Returns void

    • Get the value encoded as a string. The string is not XML escaped. If value is null return "null".

      Returns string

    • Return this element type's Fantom value type or null if this is a non-value type such as obj.

      Returns Type

    • This method called whenever an it-block is applied to an object. The default implementation calls the function with this, and then returns this.

      Parameters

      • f: (arg0: this) => void

      Returns this

    • Specifies is this object can be written, or false if readonly.

      Returns boolean

    • Specifies is this object can be written, or false if readonly.

      Parameters

      • it: boolean

      Returns void

    • Write this ObixObj as an XML document to the specified stream. No XML prolog is specified so that this method can used to write a snippet of the overall document.

      Parameters

      Returns void

    • Write x.toStr to standard output followed by newline. If x is null then print "null". If no argument is provided then print an empty line.

      Parameters

      Returns void

    • Parameters

      • ...args: unknown[]

      Returns ObixObj

    • Parse an XML document into memory as a tree of ObixObj. If close is true, then the input stream is guaranteed to be closed.

      Parameters

      Returns ObixObj