com.kenai.jaffl
Class Address

java.lang.Object
  extended by java.lang.Number
      extended by com.kenai.jaffl.Address
All Implemented Interfaces:
Serializable, Comparable<Address>

public class Address
extends Number
implements Comparable<Address>

Represents a native memory address.

See Also:
Serialized Form

Field Summary
protected  long address
           
static long MASK
           
static int SHIFT
           
static int SIZE
           
 
Constructor Summary
Address(Address address)
          Creates a new address representation.
Address(long address)
          Creates a new address representation.
 
Method Summary
 int compareTo(Address other)
          Compares two Address instances numerically.
 double doubleValue()
          Returns an double representation of this address.
 boolean equals(Object obj)
          Compares this address to another address.
 float floatValue()
          Returns an float representation of this address.
 int hashCode()
          Gets a hash code for this Address.
 int intValue()
          Returns an integer representation of this address.
 boolean isNull()
          Tests if this Address is equivalent to C NULL
 long longValue()
          Returns an long representation of this address.
 long nativeAddress()
          Returns the native value of this address.
 String toString()
          Returns a string representation of this Address.
static Address valueOf(long address)
           
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE

SHIFT

public static final int SHIFT

MASK

public static final long MASK

address

protected final long address
Constructor Detail

Address

public Address(long address)
Creates a new address representation.

Parameters:
address - the native address.

Address

public Address(Address address)
Creates a new address representation.

Parameters:
address - the native address.
Method Detail

valueOf

public static final Address valueOf(long address)

intValue

public final int intValue()
Returns an integer representation of this address.

Specified by:
intValue in class Number
Returns:
an integer value for this address.

longValue

public final long longValue()
Returns an long representation of this address.

Specified by:
longValue in class Number
Returns:
an long value for this address.

floatValue

public final float floatValue()
Returns an float representation of this address.

Specified by:
floatValue in class Number
Returns:
an float value for this address.

doubleValue

public final double doubleValue()
Returns an double representation of this address.

Specified by:
doubleValue in class Number
Returns:
an double value for this address.

nativeAddress

public final long nativeAddress()
Returns the native value of this address.

Returns:
an long value representing the native value of this address.

hashCode

public final int hashCode()
Gets a hash code for this Address.

Overrides:
hashCode in class Object
Returns:
a hash code for this Address.

equals

public final boolean equals(Object obj)
Compares this address to another address.

Overrides:
equals in class Object
Parameters:
obj - the other address to compare to.
Returns:
true if this Address is equal to the other address, else false.

toString

public String toString()
Returns a string representation of this Address.

Overrides:
toString in class Object
Returns:
a string representation of this Address.

compareTo

public final int compareTo(Address other)
Compares two Address instances numerically.

Specified by:
compareTo in interface Comparable<Address>
Parameters:
other - the other Address to compare to.
Returns:
0 if other is equal to this instance, -1 if this instance is numerically less than other or 1 if this instance is numerically greater than other.

isNull

public final boolean isNull()
Tests if this Address is equivalent to C NULL

Returns:
true if the address is 0


Copyright © 2011. All Rights Reserved.