Class Scene2DToken.Scene2DType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Type
    Enclosing class:
    Scene2DToken

    public static class Scene2DToken.Scene2DType
    extends java.lang.Object
    implements Type, java.io.Serializable, java.lang.Cloneable
    The two dimensional scene type corresponding with a SceneToken.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Scene2DType()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Type add​(Type rightArgumentType)
      Return a new type which represents the type that results from adding a token of this type and a token of the given argument type.
      java.lang.Object clone()
      Return this, that is, return the reference to this object.
      Token convert​(Token token)
      Convert the specified token to a token having the type represented by this object.
      Type divide​(Type rightArgumentType)
      Return a new type which represents the type that results from dividing a token of this type and a token of the given argument type.
      boolean equals​(Type t)
      Determine if the argument represents the same BaseType as this object.
      java.lang.Class getTokenClass()
      Return the class for tokens that this basetype represents.
      int getTypeHash()
      Return this type's figure index in the (constant) type lattice.
      boolean isAbstract()
      Return true if this type does not correspond to a single token class.
      boolean isCompatible​(Type type)
      Test if the argument type is compatible with this type.
      boolean isConstant()
      Test if this Type is UNKNOWN.
      boolean isInstantiable()
      Determine if this type corresponds to an instantiable token classes.
      boolean isSubstitutionInstance​(Type type)
      Return true if the argument is a substitution instance of this type.
      Type modulo​(Type rightArgumentType)
      Return a new type which represents the type that results from moduloing a token of this type and a token of the given argument type.
      Type multiply​(Type rightArgumentType)
      Return a new type which represents the type that results from multiplying a token of this type and a token of the given argument type.
      Type one()
      Return the type of the multiplicative identity for elements of this type.
      Type subtract​(Type rightArgumentType)
      Return a new type which represents the type that results from subtracting a token of this type and a token of the given argument type.
      java.lang.String toString()
      Return the string representation of this type.
      Type zero()
      Return the type of the additive identity for elements of this type.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface ptolemy.data.type.Type

        equals
    • Constructor Detail

      • Scene2DType

        public Scene2DType()
    • Method Detail

      • add

        public Type add​(Type rightArgumentType)
        Return a new type which represents the type that results from adding a token of this type and a token of the given argument type.
        Specified by:
        add in interface Type
        Parameters:
        rightArgumentType - The type to add to this type.
        Returns:
        This type.
      • clone

        public java.lang.Object clone()
        Return this, that is, return the reference to this object.
        Specified by:
        clone in interface Type
        Overrides:
        clone in class java.lang.Object
        Returns:
        A BaseType.
      • divide

        public Type divide​(Type rightArgumentType)
        Return a new type which represents the type that results from dividing a token of this type and a token of the given argument type.
        Specified by:
        divide in interface Type
        Parameters:
        rightArgumentType - The type to add to this type.
        Returns:
        This type.
      • getTokenClass

        public java.lang.Class getTokenClass()
        Return the class for tokens that this basetype represents.
        Specified by:
        getTokenClass in interface Type
        Returns:
        the class for tokens that this basetype represents.
      • isAbstract

        public boolean isAbstract()
        Return true if this type does not correspond to a single token class. This occurs if the type is not instantiable, or it represents either an abstract base class or an interface.
        Specified by:
        isAbstract in interface Type
        Returns:
        Always return false, this token is instantiable.
      • isCompatible

        public boolean isCompatible​(Type type)
        Test if the argument type is compatible with this type. The method returns true if this type is UNKNOWN, since any type is a substitution instance of it. If this type is not UNKNOWN, this method returns true if the argument type is less than or equal to this type in the type lattice, and false otherwise.
        Specified by:
        isCompatible in interface Type
        Parameters:
        type - An instance of Type.
        Returns:
        True if the argument type is compatible with this type.
      • isConstant

        public boolean isConstant()
        Test if this Type is UNKNOWN.
        Specified by:
        isConstant in interface Type
        Returns:
        True if this Type is not UNKNOWN; false otherwise.
      • equals

        public boolean equals​(Type t)
        Determine if the argument represents the same BaseType as this object.
        Parameters:
        t - A Type.
        Returns:
        True if the argument represents the same BaseType as this object; false otherwise.
      • getTypeHash

        public int getTypeHash()
        Return this type's figure index in the (constant) type lattice.
        Specified by:
        getTypeHash in interface Type
        Returns:
        this type's figure index in the (constant) type lattice.
      • isInstantiable

        public boolean isInstantiable()
        Determine if this type corresponds to an instantiable token classes. A BaseType is instantiable if it does not correspond to an abstract token class, or an interface, or UNKNOWN.
        Specified by:
        isInstantiable in interface Type
        Returns:
        True if this type is instantiable.
      • isSubstitutionInstance

        public boolean isSubstitutionInstance​(Type type)
        Return true if the argument is a substitution instance of this type.
        Specified by:
        isSubstitutionInstance in interface Type
        Parameters:
        type - A Type.
        Returns:
        True if this type is UNKNOWN; false otherwise.
      • modulo

        public Type modulo​(Type rightArgumentType)
        Return a new type which represents the type that results from moduloing a token of this type and a token of the given argument type.
        Specified by:
        modulo in interface Type
        Parameters:
        rightArgumentType - The type to add to this type.
        Returns:
        This type.
      • multiply

        public Type multiply​(Type rightArgumentType)
        Return a new type which represents the type that results from multiplying a token of this type and a token of the given argument type.
        Specified by:
        multiply in interface Type
        Parameters:
        rightArgumentType - The type to add to this type.
        Returns:
        This type.
      • one

        public Type one()
        Return the type of the multiplicative identity for elements of this type.
        Specified by:
        one in interface Type
        Returns:
        This type.
      • subtract

        public Type subtract​(Type rightArgumentType)
        Return a new type which represents the type that results from subtracting a token of this type and a token of the given argument type.
        Specified by:
        subtract in interface Type
        Parameters:
        rightArgumentType - The type to add to this type.
        Returns:
        This type.
      • toString

        public java.lang.String toString()
        Return the string representation of this type.
        Specified by:
        toString in interface Type
        Overrides:
        toString in class java.lang.Object
        Returns:
        A String.
      • zero

        public Type zero()
        Return the type of the additive identity for elements of this type.
        Specified by:
        zero in interface Type
        Returns:
        Return this type.