Skip to content
Reference > Classes

Integer

Definition

Integer var = .... ;

Extends

Extended By

None

Description

An integer number

Method Summary

Owner Name Return Type Description
Integer constructor(value) Object Initialize an Integer object.
Object getClassName() String Returns the string name of this object's class type.
Integer highestOneBit() Integer Returns an int value with a single one-bit in the position of the highest-order ("leftmost") one-bit of the supplied integer value, or 0 if the value supplied is 0.
Integer lowestOneBit() Integer Returns an Int value with a single one-bit in the position of the lowest-order ("rightmost") one-bit of the supplied integer value, or 0 if the value supplied is 0.
Integer numberOfLeadingZeros() Integer Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified integer value.
Integer numberOfTrailingZeros() Integer Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified integer value.
Object toJson() String Returns a string of a json representation of this object.

Method Definitions


constructor(value)

Integer integer = new Integer(Integer value)

Description

Initialize an Integer object.

Parameter Definition

Name Type Description
value Integer  an integer value

getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.

Example 5

1
2
3
4
Int i = 100;
i.getClassName();

// i.getClassName() = Integer

highestOneBit()

Integer Integer::highestOneBit()

Description

Returns an int value with a single one-bit in the position of the highest-order ("leftmost") one-bit of the supplied integer value, or 0 if the value supplied is 0.

Example 1

1
2
3
4
Int i = 100;
i.highestOneBit();

// i.highestOneBit() = 64

lowestOneBit()

Integer Integer::lowestOneBit()

Description

Returns an Int value with a single one-bit in the position of the lowest-order ("rightmost") one-bit of the supplied integer value, or 0 if the value supplied is 0.

Example 1

1
2
3
4
Int i = 100;
i.lowestOneBit();

// i.lowestOneBit() = 4

numberOfLeadingZeros()

Integer Integer::numberOfLeadingZeros()

Description

Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified integer value.

Example 1

1
2
3
4
Int i = 100;
i.numberOfLeadingZeros();

// i.numberOfLeadingZeros() = 25

numberOfTrailingZeros()

Integer Integer::numberOfTrailingZeros()

Description

Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified integer value.

Example 1

1
2
3
4
Int i = 100;
i.numberOfTrailingZeros();

// i.numberOfTrailingZeros() = 2

toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.

Example 5

1
2
3
4
Int i = 100;
i.toJson();

// i.toJson() = 100