Package
Classpublic class Long
InheritanceLong Inheritance Object

The Long implementation for flex to support 64 bit Integers



Public Properties
 PropertyDefined By
  isNegative : Boolean
Checks if the long isNegative bit is set
Long
  lower : uint
This returns the lower 32 bits of the long
Long
  MAX_VALUE_JAVA : Long
[static] [read-only]
Long
  NEGATIVE_ONE : Long
[static] [read-only]
Long
  upper : uint
This returns the upper 32 bits of the long
Long
  ZERO : Long
[static] [read-only]
Long
Public Methods
 MethodDefined By
  
Long(upper:uint, lower:uint, isNegative:Boolean = false)
Construct a new Long type.
Long
  
addInt(value:int):Long
Adds the given int value to the long
Long
  
clearBit(value:uint):void
Clears the bit at a given location in the long
Long
  
compareTo(value:Long):int
Compares this instance to the passed in instance, equals zero if they are the same.
Long
  
fromNum(value:Number):Long
[static] Creates a long from a number.
Long
  
isBitSet(value:uint):Boolean
Checks if a bit at a given location within the Long is set
Long
  
isValueSame(value:Long):Boolean
Similar to compareTo only this returns a boolean if they match or not as opposed to returning the difference
Long
  
isZero():Boolean
Checks if this instance is equal to zero
Long
  
setBit(value:uint):void
Sets a bit at the given location in the long
Long
  
shiftLeft(value:uint):Long
The bitwise shift left operation, creates a new Long.
Long
  
shiftRight(value:uint):Long
The bitwise shift right operation is a unsigned right shift and creates a new Long with the value
Long
  
toNum():Number
Returns a number representation of the current long.
Long
  
toString(value:uint = 16):String
Returns a string representation of this long, hexadecimal and decimal are the only supported radix types.
Long
Property Detail
isNegativeproperty
isNegative:Boolean

Checks if the long isNegative bit is set


Implementation
    public function get isNegative():Boolean
    public function set isNegative(value:Boolean):void
lowerproperty 
lower:uint

This returns the lower 32 bits of the long


Implementation
    public function get lower():uint
    public function set lower(value:uint):void
MAX_VALUE_JAVAproperty 
MAX_VALUE_JAVA:Long  [read-only]


Implementation
    public static function get MAX_VALUE_JAVA():Long
NEGATIVE_ONEproperty 
NEGATIVE_ONE:Long  [read-only]


Implementation
    public static function get NEGATIVE_ONE():Long
upperproperty 
upper:uint

This returns the upper 32 bits of the long


Implementation
    public function get upper():uint
    public function set upper(value:uint):void
ZEROproperty 
ZERO:Long  [read-only]


Implementation
    public static function get ZERO():Long
Constructor Detail
Long()Constructor
public function Long(upper:uint, lower:uint, isNegative:Boolean = false)

Construct a new Long type.

Parameters
upper:uint — a uint for the top 32 bits
 
lower:uint — a uint for the lower 32 bits
 
isNegative:Boolean (default = false) — a boolean specifying if the number is negative
Method Detail
addInt()method
public function addInt(value:int):Long

Adds the given int value to the long

Parameters
value:int — a int that needs to be added to the long

Returns
Long — long a new long created from adding the int and the long together
clearBit()method 
public function clearBit(value:uint):void

Clears the bit at a given location in the long

Parameters
value:uint — a uint specifying the location to clear the bit

compareTo()method 
public function compareTo(value:Long):int

Compares this instance to the passed in instance, equals zero if they are the same.

Parameters
value:Long — a long to compare this instance to.

Returns
int — int equal to 0 if they are the same
fromNum()method 
public static function fromNum(value:Number):Long

Creates a long from a number.

Parameters
value:Number — A number that will be converted to a Long

Returns
Long — Long the long representation of the given value
isBitSet()method 
public function isBitSet(value:uint):Boolean

Checks if a bit at a given location within the Long is set

Parameters
value:uint — a uint specifying the location to check if the bit is set

Returns
Boolean — true if the bit is set
isValueSame()method 
public function isValueSame(value:Long):Boolean

Similar to compareTo only this returns a boolean if they match or not as opposed to returning the difference

Parameters
value:Long — a long to compare against this instance

Returns
Boolean — true if they are equal values
isZero()method 
public function isZero():Boolean

Checks if this instance is equal to zero

Returns
Boolean — true if this instance of long is equal to zero
setBit()method 
public function setBit(value:uint):void

Sets a bit at the given location in the long

Parameters
value:uint — a uint of the location of the bit to set

shiftLeft()method 
public function shiftLeft(value:uint):Long

The bitwise shift left operation, creates a new Long.

Parameters
value:uint — a uint to shift left by.

Returns
Long — Long a new long with the value after the shift
shiftRight()method 
public function shiftRight(value:uint):Long

The bitwise shift right operation is a unsigned right shift and creates a new Long with the value

Parameters
value:uint — a uint specifying the number to shift right by.

Returns
Long — Long a new long with the value after the shift
toNum()method 
public function toNum():Number

Returns a number representation of the current long. Note: A number is only precise to 53 bits so accuracy could be lost.

Returns
Number — A number representation of a long.
toString()method 
public function toString(value:uint = 16):String

Returns a string representation of this long, hexadecimal and decimal are the only supported radix types.

Parameters
value:uint (default = 16) — a uint specifying the radix to return, default is 16(hexadecimal) else 10(decimal).

Returns
String — string a string representation of the long