Servertec
Jenie
1.0.1 09/04/2005

stec.jenie
Class Pointer

java.lang.Object
  extended by stec.jenie.NativeObject
      extended by stec.jenie.Pointer
All Implemented Interfaces:
NativeParameter
Direct Known Subclasses:
HANDLE

public class Pointer
extends NativeObject
implements NativeParameter

Represents a native pointer value.

Depending on the platform values are native 32-bit or 64-bit pointers.

Since:
1.0.0 12/05/2004

Field Summary
static int SIZEOF
          The size in bytes of a pointer.
 
Constructor Summary
Pointer()
          Constructs a new pointer.
Pointer(Callback callback)
          Constucts a new pointer pointing to the specified callback.
Pointer(long pointer)
          Constucts a new pointer pointing to the specified location.
Pointer(long pointer, int size)
          Constucts a new pointer pointing to the specified location.
Pointer(NativeObject object)
          Constucts a new pointer pointing to the specified native object.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this pointer.
 boolean equals(java.lang.Object object)
          Returns whether this pointer equals the specified pointer.
 long getValue()
          Returns the current value.
 int hashCode()
          Returns the hash code of this pointer.
 boolean isNull()
          Returns whether this pointer points null.
 void setValue(Callback callback)
          Points this pointer to the specified callback.
 void setValue(long pointer)
          Points this pointer to the specified location.
 void setValue(long pointer, int size)
          Points this pointer to the specified location.
 void setValue(NativeObject object)
          Points this pointer to the specified native object.
 java.lang.String toString()
          Returns a String representation of this pointer.
 
Methods inherited from class stec.jenie.NativeObject
getAlignment, getNativeAddress, getNativeBuffer, getNativeBufferHandle, setNativeBuffer, setNativeBuffer, setNativeBuffer, size
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stec.jenie.NativeParameter
getNativeBufferHandle
 

Field Detail

SIZEOF

public static final int SIZEOF
The size in bytes of a pointer.

Constructor Detail

Pointer

public Pointer()
        throws java.lang.OutOfMemoryError
Constructs a new pointer.

Defaults to null.

Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

Pointer

public Pointer(long pointer)
        throws java.lang.OutOfMemoryError
Constucts a new pointer pointing to the specified location.

Parameters:
pointer - the location to point to.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

Pointer

public Pointer(long pointer,
               int size)
        throws java.lang.OutOfMemoryError
Constucts a new pointer pointing to the specified location.

Parameters:
pointer - the location to point to.
size - the size of the native buffer.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

Pointer

public Pointer(NativeObject object)
        throws java.lang.OutOfMemoryError
Constucts a new pointer pointing to the specified native object.

Parameters:
object - the the native object to point to.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

Pointer

public Pointer(Callback callback)
        throws java.lang.OutOfMemoryError
Constucts a new pointer pointing to the specified callback.

Parameters:
callback - the callback to point to.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.
Method Detail

getValue

public long getValue()
Returns the current value.

Returns:
the current value.

setValue

public void setValue(NativeObject object)
Points this pointer to the specified native object.

Parameters:
object - the native object to point to.

setValue

public void setValue(Callback callback)
Points this pointer to the specified callback.

Parameters:
callback - the callback to point to.

setValue

public void setValue(long pointer)
Points this pointer to the specified location.

Parameters:
pointer - the location to point to.

setValue

public void setValue(long pointer,
                     int size)
Points this pointer to the specified location.

Parameters:
pointer - the location to point to.
size - the size of the native buffer.

toString

public java.lang.String toString()
Returns a String representation of this pointer.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this pointer.

equals

public boolean equals(java.lang.Object object)
Returns whether this pointer equals the specified pointer.

Overrides:
equals in class NativeObject
Parameters:
object - the pointer to compare against.
Returns:
whether this pointer equals the specified pointer.

hashCode

public int hashCode()
Returns the hash code of this pointer.

Overrides:
hashCode in class NativeObject
Returns:
the hash code of this pointer.

clone

public java.lang.Object clone()
                       throws java.lang.OutOfMemoryError
Returns a clone of this pointer.

Specified by:
clone in interface NativeParameter
Specified by:
clone in class NativeObject
Returns:
the clone of this pointer.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

isNull

public boolean isNull()
Returns whether this pointer points null.

Returns:
whether this pointer points null.

Servertec
Jenie
1.0.1 09/04/2005

Copyright © 2004-2005 Servertec. All rights reserved.