Libraries.Language.Types.Integer Documentation

The Integer class is the object representation of the primitive type integer.

Example Code

class Main
   action Main
      integer age = 15
      Integer result = test(age)
   end
   action test(Integer int) returns Integer
        return int
   end
e

Inherits from: Libraries.Language.Object

Summary

Variable Summary Table

VariablesDescription
integer maximumValue
integer minimumValueThis action sets the value of the integer object.

Actions Summary Table

ActionsDescription
BitCount()This action determines the number of one bits in the integer value.
Compare(Libraries.Language.Object object)This action compares two object values and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their values.
GetBinary()This action gets the binary representation of the integer value.
GetHashCode()This action gets the hash code for an object.
GetHex()This action gets the hex representation of the integer value.
GetMaximumValue()This action gets the maximum value allowed for an integer variable(2147483647).
GetMinimumValue()This action gets the minimum value allowed for an integer variable(-2147483648).
GetNumber()This action gets the value from the Integer object and casts it to a number.
GetOctal()This action gets the octal representation of the integer value.
GetText()This action gets the value from the integer object and casts it to a text value.
GetValue()This action gets the value from the integer object.
HighestOneBit()This action determines the highest(left most) one bit in the two's compliment binary representation of the integer.
LeadingZeros()This action determines the number of leading zeros on the two's compliment binary representation of the integer value.
LowestOneBit()This action determines the lowest(right most) one bit in the two's compliment binary representation of the integer.
Reverse()This action determines the reverse of the two's compliment binary representation of the integer value.
RotateLeft(integer value)This action rotates left the two's compliment binary representation of the integer value by a specified number of positions.
RotateRight(integer value)This action rotates right the two's compliment binary representation of the integer value by a specified number of positions.
SetValue(integer i)This action sets the value of the integer object.
TrailingZeros()This action determines the number of trailing zeros on the two's compliment binary representation of the integer value.

Actions Documentation

BitCount()

This action determines the number of one bits in the integer value. This integer value is represented as two's compliment binary representation.

Example Code

integer i = 3
        integer result = i:BitCount

Return

integer: The number of one bits in the integer value.

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.

Example Code

Integer o
        Integer t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smalle

Parameters

Return

integer: The Comprare result, Smaller (-1), Equal (0), or Larger (1).

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their values.

Example Code

Integer o
        Integer t
        boolean result = o:Equals(

Parameters

Return

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

GetBinary()

This action gets the binary representation of the integer value.

Example Code

integer i = 3
        text result = i:GetBinary

Return

text: The binary representation of the integer.

GetHashCode()

This action gets the hash code for an object. In this case, GetHashCode is overriden to be equivalent to the hash code of its containing object, value.

Example Code

Object o
        integer hash = o:GetHashCode

Return

integer: The integer hash code of the object.

GetHex()

This action gets the hex representation of the integer value.

Example Code

integer i = 3
        text result = i:GetHex

Return

text: The hex representation of the integer.

GetMaximumValue()

This action gets the maximum value allowed for an integer variable(2147483647).

Example Code

Integer size
        integer max = size:GetMaximumValue

Return

integer: The maximum value that can be stored in an integer.

GetMinimumValue()

This action gets the minimum value allowed for an integer variable(-2147483648).

Example Code

Integer size
        integer min = size:GetMinimumValue

Return

integer: The minimum value that can be stored in an integer.

GetNumber()

This action gets the value from the Integer object and casts it to a number.

Example Code

Integer age
        number result = age:GetNumber

Return

number: The value of the object converted to a number.

GetOctal()

This action gets the octal representation of the integer value.

Example Code

integer i = 3
        text result = i:GetOctal

Return

text: The octal representation of the integer.

GetText()

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

Example Code

Integer age
        text result = age:GetText

Return

text: The value of the object converted to text.

GetValue()

This action gets the value from the integer object.

Example Code

Integer age
        integer result = age:GetValue

Return

integer: The value of the object.

HighestOneBit()

This action determines the highest(left most) one bit in the two's compliment binary representation of the integer.

Example Code

integer i = 3
        integer result = i:HighestOneBit

Return

integer: The location of the highest one bit in the integer value.

LeadingZeros()

This action determines the number of leading zeros on the two's compliment binary representation of the integer value.

Example Code

integer i = 3
        integer result = i:LeadingZeros

Return

integer: The number of leading zeros.

LowestOneBit()

This action determines the lowest(right most) one bit in the two's compliment binary representation of the integer.

Example Code

integer i = 3
        integer result = i:LowestOneBit

Return

integer: The location of the lowest one bit in the integer value.

Reverse()

This action determines the reverse of the two's compliment binary representation of the integer value.

Example Code

integer i = 3
        integer result = i:Reverse

Return

integer: The reverse of the two's compliment of the integer value.

RotateLeft(integer value)

This action rotates left the two's compliment binary representation of the integer value by a specified number of positions.

Example Code

integer i = 3
        integer result = i:RotateLeft(

Parameters

Return

integer: The rotated left integer.

RotateRight(integer value)

This action rotates right the two's compliment binary representation of the integer value by a specified number of positions.

Example Code

integer i = 3
        integer result = i:RotateRight(

Parameters

Return

integer: The rotated right integer.

SetValue(integer i)

This action sets the value of the integer object.

Example Code

Integer age
        age:SetValue(1

Parameters

TrailingZeros()

This action determines the number of trailing zeros on the two's compliment binary representation of the integer value.

Example Code

integer i = 3
        integer result = i:TrailingZeros

Return

integer: The number of trailing zeros.