|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.data.Token
ptolemy.actor.lib.jni.PointerToken
public class PointerToken
A token that contains the memory location of a C object. Used to maintain C objects between JNI calls. Attempts to access the object from Java will raise an IllegalActionException.
Note that this class assumes a 32-bit memory size so that an pointer may be held in an integer. Actors that use this class are not likely to work on a 64-bit machine, see Bug 285 - Codegen PointerTokens do not work on 64 bit Java because PointerToken assumes 32 bits
Red |
Red (tbf) |
Nested Class Summary | |
---|---|
static class |
PointerToken.PointerType
The pointer type. |
Field Summary | |
---|---|
private static boolean |
_checked32Bit
True if we have checked that we are on a 32 Bit platform. |
private static boolean |
_is32Bit
True if we are on a 32Bit platform. |
private int |
_value
The memory address of the pointer. |
static Type |
POINTER
The Pointer type: the least upper bound of all the pointer types. |
Fields inherited from class ptolemy.data.Token |
---|
NIL |
Constructor Summary | |
---|---|
PointerToken()
Construct an empty token. |
|
PointerToken(int pointer)
Construct a token with the specified memory location. |
Method Summary | |
---|---|
private static void |
_check32Bit()
|
Type |
getType()
Return the type of this token. |
int |
getValue()
Return the address of the pointer. |
static boolean |
is32Bit()
Return true if this is a 32bit JVM. |
BooleanToken |
isEqualTo(Token rightArgument)
Test for equality of the values of this Token and the argument Token. |
java.lang.String |
toString()
Return a String representation of the PointerToken, including the address. |
Methods inherited from class ptolemy.data.Token |
---|
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Type POINTER
private static boolean _checked32Bit
private static boolean _is32Bit
private int _value
Constructor Detail |
---|
public PointerToken()
public PointerToken(int pointer) throws IllegalActionException
pointer
- The specified object referred to by this token.
IllegalActionException
- If the argument is not of
the appropriate type
(may be thrown by derived classes, but is not thrown here).Method Detail |
---|
public Type getType()
getType
in class Token
POINTER
, the least upper bound of all the pointer
types.public int getValue()
public final BooleanToken isEqualTo(Token rightArgument) throws IllegalActionException
isEqualTo
in class Token
rightArgument
- The Token to test against.
IllegalActionException
- Not thrown in this base class.public java.lang.String toString()
toString
in class Token
public static boolean is32Bit()
private static void _check32Bit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |