Skip to content
Reference > Classes

Long

Definition

Long var = .... ;

Extends

Extended By

None

Description

A number of type Long.

Method Summary

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

Method Definitions


constructor(value)

Long long = new Long(Long value)

Description

Initialize a Long object.

Parameter Definition

Name Type Description
value Long  a long value

Example 1

1
2
3
Long l = 100l;

// l = 100

byteValue()

Byte Long::byteValue()

Description

Returns the value of this Long as a Byte after a narrowing primitive conversion.

Example 1

1
2
3
4
Long l = 100;
l.byteValue();

// l.byteValue() = 100

getClassName()

String Object::getClassName()

Description

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

Example 6

1
2
3
4
Long l = 100;
l.getClassName();

// l.getClassName() = Long

highestOneBit()

Long Long::highestOneBit()

Description

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

Example 1

1
2
3
4
Long l = 100;
l.highestOneBit();

// l.highestOneBit() = 64

lowestOneBit()

Long Long::lowestOneBit()

Description

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

Example 1

1
2
3
4
Long l = 100;
l.lowestOneBit();

// l.lowestOneBit() = 4

numberOfLeadingZeros()

Integer Long::numberOfLeadingZeros()

Description

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

Example 1

1
2
3
4
Long l = 100;
l.numberOfLeadingZeros();

// l.numberOfLeadingZeros() = 57

numberOfTrailingZeros()

Integer Long::numberOfTrailingZeros()

Description

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

Example 1

1
2
3
4
Long l= 100;
l.numberOfTrailingZeros();

// l.numberOfTrailingZeros() = 2

toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.

Example 6

1
2
3
4
Long l = 100;
l.toJson();

// l.toJson() = 100