JavaTM 2 Platform
Std. Ed. v1.3.1

com.apple.mrj.jdirect
Class GenericPointer

java.lang.Object
  |
  +--com.apple.mrj.jdirect.GenericPointer

public class GenericPointer
extends Object

GenericPointer is the base class for a platform dependent Pointer. No range checking is performed on this memory.


Field Summary
protected  int pointer
          The data for this Data is stored in the MacOS heap.
 
Constructor Summary
GenericPointer(int pointer)
          Construct a GenericPointer which wraps arbitrary platform memory
 
Method Summary
 boolean equals(Object anObject)
          Returns true if both java objects reference the same MacOS heap pointer
 boolean getBooleanAt(int offset)
           
 byte getByteAt(int offset)
           
 byte[] getBytesAt(int byteOffset, int byteCount)
          Returns the byteCount bytes of data from byteOffset in this struct as a byte array.
 char getCharAt(int offset)
           
 double getDoubleAt(int offset)
           
 float getFloatAt(int offset)
           
 int getIntAt(int offset)
           
 long getLongAt(int offset)
           
 int getPointer()
          Returns the pointer held by the PointerObject.
 short getShortAt(int offset)
           
 void setBooleanAt(int offset, boolean value)
           
 void setByteAt(int offset, byte value)
           
 void setBytesAt(int byteOffset, byte[] source)
          Copies the byteCount bytes of data to byteOffset in this struct from a byte array.
 void setCharAt(int offset, char value)
           
 void setDoubleAt(int offset, double value)
           
 void setFloatAt(int offset, float value)
           
 void setIntAt(int offset, int value)
           
 void setLongAt(int offset, long value)
           
 void setShortAt(int offset, short value)
           
 void setStructAt(int byteOffset, Struct src)
          Sets the data in a range of this from another Struct
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pointer

protected int pointer
The data for this Data is stored in the MacOS heap. This int holds the MacOS Handle to arbitrary data.
Constructor Detail

GenericPointer

public GenericPointer(int pointer)
Construct a GenericPointer which wraps arbitrary platform memory
Parameters:
pointer - a MacOS memory pointer
Method Detail

getBooleanAt

public final boolean getBooleanAt(int offset)

getByteAt

public final byte getByteAt(int offset)

getCharAt

public final char getCharAt(int offset)

getShortAt

public final short getShortAt(int offset)

getIntAt

public final int getIntAt(int offset)

getLongAt

public final long getLongAt(int offset)

getFloatAt

public final float getFloatAt(int offset)

getDoubleAt

public final double getDoubleAt(int offset)

setBooleanAt

public final void setBooleanAt(int offset,
                               boolean value)

setByteAt

public final void setByteAt(int offset,
                            byte value)

setCharAt

public final void setCharAt(int offset,
                            char value)

setShortAt

public final void setShortAt(int offset,
                             short value)

setIntAt

public final void setIntAt(int offset,
                           int value)

setLongAt

public final void setLongAt(int offset,
                            long value)

setFloatAt

public final void setFloatAt(int offset,
                             float value)

setDoubleAt

public final void setDoubleAt(int offset,
                              double value)

setBytesAt

public void setBytesAt(int byteOffset,
                       byte[] source)
Copies the byteCount bytes of data to byteOffset in this struct from a byte array.

setStructAt

public void setStructAt(int byteOffset,
                        Struct src)
Sets the data in a range of this from another Struct

getBytesAt

public byte[] getBytesAt(int byteOffset,
                         int byteCount)
Returns the byteCount bytes of data from byteOffset in this struct as a byte array.

getPointer

public final int getPointer()
Returns the pointer held by the PointerObject.
Returns:
a raw machine pointer

equals

public boolean equals(Object anObject)
Returns true if both java objects reference the same MacOS heap pointer
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.