Package ptolemy.actor

Class 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$
    Author:
    Yuhong Xiong
    See Also:
    TypeListener
    Pt.AcceptedRating:
    Green (cxh)
    Pt.ProposedRating:
    Green (yuhong)
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeEvent​(Typeable typeable, Type oldType, Type newType)
      Construct a TypeEvent, with the specified Typeable and the old and new types.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 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.