ptolemy.actor
Class TypeEvent

java.lang.Object
  extended byptolemy.actor.TypeEvent
All Implemented Interfaces:
DebugEvent

public class TypeEvent
extends java.lang.Object
implements DebugEvent

A TypeEvent represents a type change on a Typeable object. This event is generated by the Typeable whose type is changed, and is passed to the type change listeners to notify them about the change.

Since:
Ptolemy II 0.2
Version:
$Id: TypeEvent.java,v 1.23 2004/04/13 02:58:13 cxh Exp $
Author:
Yuhong Xiong
See Also:
TypeListener
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (yuhong)

Constructor Summary
TypeEvent(Typeable typeable, Type oldType, Type newType)
          Construct a TypeEvent, with the specified Typeable and the old and new types.
 
Method Summary
 Type getNewType()
          Return the new type.
 Type getOldType()
          Return the old type.
 NamedObj getSource()
          Return the Typeable whose type is changed.
 java.lang.String toString()
          Return a string description for this type change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeEvent

public TypeEvent(Typeable typeable,
                 Type oldType,
                 Type newType)
Construct a TypeEvent, with the specified Typeable and the old and new types.

Parameters:
typeable - The Typeable whose type is changed.
oldType - The type of the Typeable before the change.
newType - The type of the Typeable after the change.
Method Detail

getNewType

public Type getNewType()
Return the new type.

Returns:
The type of the Typeable after the change.

getOldType

public Type getOldType()
Return the old type.

Returns:
The type of the Typeable before the change.

getSource

public NamedObj getSource()
Return the Typeable whose type is changed.

Specified by:
getSource in interface DebugEvent
Returns:
The Typeable whose type is changed.

toString

public java.lang.String toString()
Return a string description for this type change. The string is "The type on has changed from to ", where is the name of the Typeable, and and are the string representation of the types.

Specified by:
toString in interface DebugEvent
Returns:
A string description for this type change.