ptolemy.actor
Class TypeEvent

java.lang.Object
  extended by ptolemy.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 57040 2010-01-27 20:52:32Z cxh $
Author:
Yuhong Xiong
See Also:
TypeListener
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (yuhong)

Field Summary
private  Type _newType
           
private  Type _oldType
           
private  Typeable _typeable
           
 
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
 

Field Detail

_typeable

private Typeable _typeable

_oldType

private Type _oldType

_newType

private Type _newType
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 typeable has changed from old type to new type", where typeable is the name of the Typeable, and old type and new type are the string representation of the types.

Specified by:
toString in interface DebugEvent
Overrides:
toString in class java.lang.Object
Returns:
A string description for this type change.