Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Boolean

Represents a boolean[1] value in an Ion stream.

Because this class extends Javascript's (big-B) Boolean data type, it is subject to the same surprising behavior when used for control flow.

From the Mozilla Developer Network documentation[2]:

Any object of which the value is not undefined or null, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement.

 var b = false;
 if (b) {
     // this code will NOT be executed
 }

 b = new Boolean(false);
 if (b) {
     // this code WILL be executed
 }

[1] http://amzn.github.io/ion-docs/docs/spec.html#bool [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#Description

Hierarchy

  • newClass<BooleanConstructor, this> & Boolean
    • Boolean

Implements

Index

Constructors

constructor

  • new Boolean(value: boolean, annotations?: string[]): Boolean
  • Constructor.

    Parameters

    • value: boolean

      The boolean value of the new instance.

    • Default value annotations: string[] = []

      An optional array of strings to associate with value.

    Returns Boolean

Properties

_ionAnnotations

_ionAnnotations: string[]

_ionType

_ionType: IonType

Static Boolean

Boolean: BooleanConstructor

Methods

_setAnnotations

  • _setAnnotations(annotations: string[]): void

_unsupportedOperation

  • _unsupportedOperation<T>(functionName: string): never

_valueEquals

  • _valueEquals(other: any, options?: { epsilon?: number | null; ignoreAnnotations?: undefined | false | true; ignoreTimestampPrecision?: undefined | false | true; onlyCompareIon?: undefined | false | true }): boolean
  • Parameters

    • other: any
    • Default value options: { epsilon?: number | null; ignoreAnnotations?: undefined | false | true; ignoreTimestampPrecision?: undefined | false | true; onlyCompareIon?: undefined | false | true } = {epsilon: null,ignoreAnnotations: false,ignoreTimestampPrecision: false,onlyCompareIon: true,}
      • Optional epsilon?: number | null
      • Optional ignoreAnnotations?: undefined | false | true
      • Optional ignoreTimestampPrecision?: undefined | false | true
      • Optional onlyCompareIon?: undefined | false | true

    Returns boolean

allFields

  • allFields(): [string, Value[]][]

as

bigIntValue

  • bigIntValue(): JSBI | null

booleanValue

  • booleanValue(): boolean

dateValue

  • dateValue(): Date | null

decimalValue

deleteField

  • deleteField(name: string): boolean

elements

equals

  • equals(other: any, options?: { epsilon?: number | null }): boolean
  • Implementation of the dom.Value interface method equals()

    Parameters

    • other: any
    • Default value options: { epsilon?: number | null } = { epsilon: null }
      • Optional epsilon?: number | null

    Returns boolean

fieldNames

  • fieldNames(): string[]

fields

  • fields(): [string, Value][]

get

getAll

getAnnotations

  • getAnnotations(): string[]

getType

ionEquals

  • ionEquals(other: Value, options?: { epsilon?: number | null; ignoreAnnotations?: undefined | false | true; ignoreTimestampPrecision?: undefined | false | true }): boolean
  • Implementation of the dom.Value interface method ionEquals()

    Parameters

    • other: Value
    • Default value options: { epsilon?: number | null; ignoreAnnotations?: undefined | false | true; ignoreTimestampPrecision?: undefined | false | true } = {epsilon: null,ignoreAnnotations: false,ignoreTimestampPrecision: false,}
      • Optional epsilon?: number | null
      • Optional ignoreAnnotations?: undefined | false | true
      • Optional ignoreTimestampPrecision?: undefined | false | true

    Returns boolean

isNull

  • isNull(): boolean

numberValue

  • numberValue(): number | null

stringValue

  • stringValue(): string | null

timestampValue

uInt8ArrayValue

  • uInt8ArrayValue(): Uint8Array | null

valueOf

  • valueOf(): boolean
  • Returns the primitive value of the specified object.

    Returns boolean

writeTo

  • writeTo(writer: Writer): void

Static _fromJsValue

  • _fromJsValue(jsValue: any, annotations: string[]): Value

Static _getIonType