com.apple.mrj.jdirect
Class PointerStruct
java.lang.Object
|
+--com.apple.mrj.jdirect.Struct
|
+--com.apple.mrj.jdirect.PointerStruct
- public abstract class PointerStruct
- extends Struct
PointerStruct is the base class for Struct classes which store
their C structs as MacOS non-relocatable heap blocks (e.g. WindowPtr).
When constructed, PointerStruct is given the MacOS memory pointer.
Field Summary |
protected int |
pointer
The data for these Structs in store in the MacOS heap. |
Constructor Summary |
protected |
PointerStruct(int pointer)
Construct a PointerStruct which wraps a C non-relocatable struct |
Method Summary |
boolean |
equals(Object anObject)
Returns true if both java objects reference the same MacOS heap pointer |
protected boolean |
getBooleanAt(int offset)
|
protected byte |
getByteAt(int offset)
|
byte[] |
getBytes()
|
byte[] |
getBytesAt(int byteOffset,
int byteCount)
|
protected char |
getCharAt(int offset)
|
protected double |
getDoubleAt(int offset)
|
protected float |
getFloatAt(int offset)
|
protected int |
getIntAt(int offset)
|
protected long |
getLongAt(int offset)
|
int |
getPointer()
Returns the pointer held by the PointerObject. |
protected short |
getShortAt(int offset)
|
abstract int |
getSize()
|
protected void |
setBooleanAt(int offset,
boolean value)
|
protected void |
setByteAt(int offset,
byte value)
|
protected void |
setBytesAt(int byteOffset,
byte[] source)
|
protected void |
setCharAt(int offset,
char value)
|
protected void |
setDoubleAt(int offset,
double value)
|
protected void |
setFloatAt(int offset,
float value)
|
protected void |
setIntAt(int offset,
int value)
|
protected void |
setLongAt(int offset,
long value)
|
protected void |
setShortAt(int offset,
short value)
|
protected void |
setStructAt(int byteOffset,
Struct src)
|
pointer
protected int pointer
- The data for these Structs in store in the MacOS heap.
This int holds the MacOS pointer to the C struct.
PointerStruct
protected PointerStruct(int pointer)
- Construct a PointerStruct which wraps a C non-relocatable struct
- Parameters:
pointer
- a MacOS memory pointer
getBooleanAt
protected final boolean getBooleanAt(int offset)
- Overrides:
getBooleanAt
in class Struct
getByteAt
protected final byte getByteAt(int offset)
- Overrides:
getByteAt
in class Struct
getCharAt
protected final char getCharAt(int offset)
- Overrides:
getCharAt
in class Struct
getShortAt
protected final short getShortAt(int offset)
- Overrides:
getShortAt
in class Struct
getIntAt
protected final int getIntAt(int offset)
- Overrides:
getIntAt
in class Struct
getLongAt
protected final long getLongAt(int offset)
- Overrides:
getLongAt
in class Struct
getFloatAt
protected final float getFloatAt(int offset)
- Overrides:
getFloatAt
in class Struct
getDoubleAt
protected final double getDoubleAt(int offset)
- Overrides:
getDoubleAt
in class Struct
setBooleanAt
protected final void setBooleanAt(int offset,
boolean value)
- Overrides:
setBooleanAt
in class Struct
setByteAt
protected final void setByteAt(int offset,
byte value)
- Overrides:
setByteAt
in class Struct
setCharAt
protected final void setCharAt(int offset,
char value)
- Overrides:
setCharAt
in class Struct
setShortAt
protected final void setShortAt(int offset,
short value)
- Overrides:
setShortAt
in class Struct
setIntAt
protected final void setIntAt(int offset,
int value)
- Overrides:
setIntAt
in class Struct
setLongAt
protected final void setLongAt(int offset,
long value)
- Overrides:
setLongAt
in class Struct
setFloatAt
protected final void setFloatAt(int offset,
float value)
- Overrides:
setFloatAt
in class Struct
setDoubleAt
protected final void setDoubleAt(int offset,
double value)
- Overrides:
setDoubleAt
in class Struct
setBytesAt
protected void setBytesAt(int byteOffset,
byte[] source)
- Overrides:
setBytesAt
in class Struct
setStructAt
protected void setStructAt(int byteOffset,
Struct src)
- Overrides:
setStructAt
in class Struct
getBytesAt
public byte[] getBytesAt(int byteOffset,
int byteCount)
- Overrides:
getBytesAt
in class Struct
getBytes
public byte[] getBytes()
- Overrides:
getBytes
in class Struct
getSize
public abstract int getSize()
- Overrides:
getSize
in class Struct
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)
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.