Boolean
Package: Libraries.Language.Types · Inherits from: Libraries.Language.Object
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
Actions
Compare(Libraries.Language.Object object)
This action compares two object values and returns an integer. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.
Parameters
objectLibraries.Language.Object: The object to compare to.
Returns
integer: The Comprare result, Smaller (-1), Equal (0), or Larger (1).
Example
Boolean o
Boolean t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their values(true or false).
Parameters
objectLibraries.Language.Object: The to be compared.
Returns
boolean: True if the values are equal and false if they
are not equal.
Example
Boolean o
Boolean t
boolean result = o:Equals(t)
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.
Returns
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
GetText()
This action gets the value from the boolean object and casts it to a text value.
Returns
text: The value of the object converted to text.
Example
Boolean isTrue
text result = isTrue:GetText()
GetValue()
This action gets the value from the boolean object.
Returns
boolean: The value of the object.
Example
Boolean isTrue
boolean result = isTrue:GetValue()
SetValue(boolean i)
This action sets the value of the boolean object.
Parameters
iboolean: The boolean value(true or false).
Example
Boolean isTrue
isTrue:SetValue(true)