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
end

Inherits from: Libraries.Language.Object

Variables Table

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

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.

Return

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

Example

integer i = 3
integer result = i:BitCount()

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

Return

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

Example

Integer o
Integer 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.

Parameters

Return

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

Example

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

GetBinary()

This action gets the binary representation of the integer value.

Return

text: The binary representation of the integer.

Example

integer i = 3
text result = i:GetBinary()

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.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetHex()

This action gets the hex representation of the integer value.

Return

text: The hex representation of the integer.

Example

integer i = 3
text result = i:GetHex()

GetMaximumValue()

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

Return

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

Example

Integer size
integer max = size:GetMaximumValue()

GetMinimumValue()

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

Return

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

Example

Integer size
integer min = size:GetMinimumValue()

GetNumber()

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

Return

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

Example

Integer age
number result = age:GetNumber()

GetOctal()

This action gets the octal representation of the integer value.

Return

text: The octal representation of the integer.

Example

integer i = 3
text result = i:GetOctal()

GetText()

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

Return

text: The value of the object converted to text.

Example

Integer age
text result = age:GetText()

GetValue()

This action gets the value from the integer object.

Return

integer: The value of the object.

Example

Integer age
integer result = age:GetValue()

HighestOneBit()

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

Return

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

Example

integer i = 3
integer result = i:HighestOneBit()

LeadingZeros()

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

Return

integer: The number of leading zeros.

Example

integer i = 3
integer result = i:LeadingZeros()

LowestOneBit()

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

Return

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

Example

integer i = 3
integer result = i:LowestOneBit()

Reverse()

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

Return

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

Example

integer i = 3
integer result = i:Reverse()

RotateLeft(integer value)

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

Parameters

  • integer value: the number of position to rotate.

Return

integer: The rotated left integer.

Example

integer i = 3
integer result = i:RotateLeft(2)

RotateRight(integer value)

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

Parameters

  • integer value: the number of position to rotate.

Return

integer: The rotated right integer.

Example

integer i = 3
integer result = i:RotateRight(2)

SetValue(integer i)

This action sets the value of the integer object.

Parameters

  • integer i: The integer value.

Example

Integer age
age:SetValue(15)

TrailingZeros()

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

Return

integer: The number of trailing zeros.

Example

integer i = 3
integer result = i:TrailingZeros()