ptolemy.actor
Class TokenSentEvent

java.lang.Object
  extended by ptolemy.actor.TokenSentEvent

Deprecated. Use IOPortEvent instead.

public class TokenSentEvent
extends java.lang.Object

An event that is published by IOPorts whenever broadcast, send or sendInside is called. The appropriate event should be published whenever a token is transfered from one port to another. In Kepler the provenance recorder uses these events to save intermediate results of the workflow. In the future these events could be used for "smart" reruns or a fault tolerance mechanism.

Since:
Ptolemy II 5.2
Version:
$Id: TokenSentEvent.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Oscar Barney
Accepted Rating:
Red (barney)
Proposed Rating:
Red (barney)

Field Summary
private  int _channel
          Deprecated.  
private  IOPort _port
          Deprecated.  
private  Token _token
          Deprecated.  
private  Token[] _tokenArray
          Deprecated.  
private  int _vectorLength
          Deprecated.  
 
Constructor Summary
TokenSentEvent(IOPort source, int channel, Token token)
          Deprecated. Create a new token sent event with the given parameters.
TokenSentEvent(IOPort source, int channel, Token[] tokens, int vectorLength)
          Deprecated. Create a new token sent event with the given parameters.
TokenSentEvent(IOPort source, Token token)
          Deprecated. Create a new token sent event with the given parameters.
TokenSentEvent(IOPort source, Token[] tokens, int vectorLength)
          Deprecated. Create a new token sent event with the given parameters.
 
Method Summary
 int getChannel()
          Deprecated. Return the channel the token was sent on.
 IOPort getPort()
          Deprecated. Return the port that the token was sent from.
 Token getToken()
          Deprecated. Return the token that was sent by the IOPort.
 Token[] getTokenArray()
          Deprecated. Return the array of tokens that the IOPort sent.
 int getVectorLength()
          Deprecated. Return the number of tokens in the array sent by the IOPort.
 java.lang.String toString()
          Deprecated. Return a string representation of this event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_channel

private int _channel
Deprecated. 

_port

private IOPort _port
Deprecated. 

_token

private Token _token
Deprecated. 

_tokenArray

private Token[] _tokenArray
Deprecated. 

_vectorLength

private int _vectorLength
Deprecated. 
Constructor Detail

TokenSentEvent

public TokenSentEvent(IOPort source,
                      int channel,
                      Token[] tokens,
                      int vectorLength)
Deprecated. 
Create a new token sent event with the given parameters. This constructor is used when an array of tokens is sent.

Parameters:
source - The IOPort the token came from.
channel - Channel the token was sent on.
tokens - The token array used for the send.
vectorLength - The number of tokens sent.

TokenSentEvent

public TokenSentEvent(IOPort source,
                      int channel,
                      Token token)
Deprecated. 
Create a new token sent event with the given parameters. This constructor is used when a token is sent or sent inside.

Parameters:
source - The IOPort the token came from.
channel - Channel the token was sent on.
token - The token that was sent.

TokenSentEvent

public TokenSentEvent(IOPort source,
                      Token token)
Deprecated. 
Create a new token sent event with the given parameters. This constructor is used when a token is broadcast.

Parameters:
source - The IOPort the token came from.
token - The token that was sent.

TokenSentEvent

public TokenSentEvent(IOPort source,
                      Token[] tokens,
                      int vectorLength)
Deprecated. 
Create a new token sent event with the given parameters. This constructor is used when an array of tokens is broadcast.

Parameters:
source - The IOPort the token came from.
tokens - The token array used for the broadcast.
vectorLength - The number of tokens sent.
Method Detail

getChannel

public int getChannel()
Deprecated. 
Return the channel the token was sent on.

Returns:
The channel number.

getPort

public IOPort getPort()
Deprecated. 
Return the port that the token was sent from.

Returns:
An instance of IOPort.

getToken

public Token getToken()
Deprecated. 
Return the token that was sent by the IOPort. The variable _token will be null if the event was for a sent array. To get the tokens that were sent use getTokenArray() instead.

Returns:
The token sent by the IOPort.

getTokenArray

public Token[] getTokenArray()
Deprecated. 
Return the array of tokens that the IOPort sent. The variable _tokenArray will be null if an individual token was sent instead of an array.

Returns:
The array of tokens which were sent.

getVectorLength

public int getVectorLength()
Deprecated. 
Return the number of tokens in the array sent by the IOPort. The variable _vectorLength will be -1 if an individual token was sent instead of an array of tokens.

Returns:
The number of tokens sent by the port.

toString

public java.lang.String toString()
Deprecated. 
Return a string representation of this event.

Overrides:
toString in class java.lang.Object
Returns:
A user-readable string describing the event.