Libraries.Language.Types.Boolean Documentation

The Boolean class is the object representation of the primitive type boolean.

Example Code

class Main
   action Main
      boolean isTrue = true
      Boolean result = test(isTrue)
   end
   action test(Boolean bool) returns Boolean
        return bool
   end
end

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object values and returns a CompareResult.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their values(true or false).
GetHashCode()This action gets the hash code for an object.
GetText()This action gets the value from the boolean object and casts it to a text value.
GetValue()This action gets the value from the boolean object.
SetValue(boolean i)This action sets the value of the boolean object.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object values and returns a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Boolean o
        Boolean t
        
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: The Comprare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their values(true or false).

Example Code

Boolean o
        Boolean t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the values are equal and false if they are not equal.

GetHashCode()

This action gets the hash code for an object. In this case, GetHashCode is overriden to return the integer 1231 if the boolean is true and 1237 if the boolean is false.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetText()

This action gets the value from the boolean object and casts it to a text value.

Example Code

Boolean isTrue
        text result = isTrue:GetText()

Return

text: The value of the object converted to text.

GetValue()

This action gets the value from the boolean object.

Example Code

Boolean isTrue
        boolean result = isTrue:GetValue()

Return

boolean: The value of the object.

SetValue(boolean i)

This action sets the value of the boolean object.

Example Code

Boolean isTrue
        isTrue:SetValue(true)

Parameters