@haxall/haxall
    Preparing search index...

    Class Version

    Version is defined as a list of decimal digits separated by the dot. Convention for Fantom pods is a four part version format of major.minor.build.patch.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Get the third segment which represents the build number. Return null if version has less than three segments.

      Returns number

    • Compare from from most significant segment to least significant segment.

      Examples:

      1.6 > 1.4
      2.0 > 1.9
      1.2.3 > 1.2
      1.11 > 1.9.3

      Parameters

      Returns number

    • Return true if equal segments.

      Parameters

      Returns boolean

    • Return toStr.hash

      Returns number

    • 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

    • Get the first, most significant segment which represents the major version.

      Returns number

    • Get the second segment which represents the minor version. Return null if version has less than two segments.

      Returns number

    • Get the fourth segment which represents the patch number. Return null if version has less than four segments.

      Returns number

    • Get a readonly list of the integer segments.

      Returns List<number>

    • 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>

    • The string format is equivalent to segments.join(".")

      Returns string

    • Trap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:

      a->x        a.trap("x", null)
      a->x() a.trap("x", null)
      a->x = b a.trap("x", [b])
      a->x(b) a.trap("x", [b])
      a->x(b, c) a.trap("x", [b, c])

      The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.

      Parameters

      Returns JsObj

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

      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

    • Default value is "0".

      Returns Version

    • 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

    • Parse a string representation into a Version. If invalid format and checked is false return null, otherwise throw ParseErr.

      Parameters

      • version: string
      • Optionalchecked: boolean
      • ...args: unknown[]

      Returns Version

    • Construct with list of integer segments. Throw ArgErr if segments is empty or contains negative numbers.

      Parameters

      • segments: List<number>
      • ...args: unknown[]

      Returns Version