ptolemy.data
Class AWTImageToken

java.lang.Object
  extended by ptolemy.data.Token
      extended by ptolemy.data.ImageToken
          extended by ptolemy.data.AWTImageToken
All Implemented Interfaces:
java.io.Serializable

public class AWTImageToken
extends ImageToken

A token that contains a java.awt.Image. This token is used in the standard image processing library.

Since:
Ptolemy II 3.0
Version:
$Id: AWTImageToken.java 57040 2010-01-27 20:52:32Z cxh $
Author:
James Yeh
See Also:
Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Field Summary
private  java.awt.Image _value
          The java.awt.Image
 
Fields inherited from class ptolemy.data.Token
NIL
 
Constructor Summary
AWTImageToken(java.awt.Image value)
          Construct a token with a specified java.awt.Image.
 
Method Summary
 java.awt.Image asAWTImage()
          Because all tokens that contain images must extend ImageToken, we must include the following method.
 Type getType()
          Return the type of this token.
 java.awt.Image getValue()
          Return the java.awt.Image object associated with this token.
 java.lang.String toString()
          Return a description of the token.
 
Methods inherited from class ptolemy.data.Token
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isEqualTo, 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

_value

private java.awt.Image _value
The java.awt.Image

Constructor Detail

AWTImageToken

public AWTImageToken(java.awt.Image value)
Construct a token with a specified java.awt.Image.

Parameters:
value - The given value
Method Detail

asAWTImage

public java.awt.Image asAWTImage()
Because all tokens that contain images must extend ImageToken, we must include the following method.

Specified by:
asAWTImage in class ImageToken
Returns:
The image.

getType

public Type getType()
Description copied from class: Token
Return the type of this token.

Overrides:
getType in class Token
Returns:
BaseType.GENERAL

getValue

public java.awt.Image getValue()
Return the java.awt.Image object associated with this token.

Returns:
the java.awt.Image object.

toString

public java.lang.String toString()
Return a description of the token. If possible, derived classes should override this method and return the value of this token as a string that can be parsed by the expression language to recover a token with the same value. Unfortunately, in this base class, we can only return the classname, the width and the height as a string representation of a record.

Overrides:
toString in class Token
Returns:
The classname, width and height as string representation of a record.