Package ptolemy.cg.lib
Class PointerToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.cg.lib.PointerToken
-
public class PointerToken extends Token
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.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Teale Fristoe
- Pt.AcceptedRating:
- Red
- Pt.ProposedRating:
- Red (tbf)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PointerToken.PointerType
The pointer type.
-
Constructor Summary
Constructors Constructor Description PointerToken()
Construct an empty token.PointerToken(int pointer)
Construct a token with the specified memory location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Type
getType()
Return the type of this token.int
getValue()
Return the address of the pointer.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
-
-
-
-
Field Detail
-
POINTER
public static final Type POINTER
The Pointer type: the least upper bound of all the pointer types.
-
-
Constructor Detail
-
PointerToken
public PointerToken()
Construct an empty token.
-
PointerToken
public PointerToken(int pointer) throws IllegalActionException
Construct a token with the specified memory location.- Parameters:
pointer
- The specified object referred to by this token.- Throws:
IllegalActionException
- If the argument is not of the appropriate type (may be thrown by derived classes, but is not thrown here).
-
-
Method Detail
-
getType
public Type getType()
Return the type of this token.
-
getValue
public int getValue()
Return the address of the pointer.- Returns:
- The int that this Token was created with.
-
isEqualTo
public final BooleanToken isEqualTo(Token rightArgument) throws IllegalActionException
Test for equality of the values of this Token and the argument Token. Two PointerTokens are equal if their addresses are equal.- Overrides:
isEqualTo
in classToken
- Parameters:
rightArgument
- The Token to test against.- Returns:
- A boolean token that contains the value true if the addresses are the same.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
-