Class ConceptType

  • All Implemented Interfaces:
    java.lang.Cloneable, Type

    public class ConceptType
    extends StructuredType
    implements java.lang.Cloneable
    A simple singleton type for all ConceptTokens.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Ben Lickly
    Pt.AcceptedRating:
    Red (blickly)
    Pt.ProposedRating:
    Red (blickly)
    • Field Detail

      • CONCEPT

        public static final ConceptType CONCEPT
        The representative type for all ConceptTokens.
    • Constructor Detail

      • ConceptType

        public ConceptType()
    • Method Detail

      • convert

        public ConceptToken convert​(Token token)
        Convert the specified token into a ConceptToken.
        Specified by:
        convert in interface Type
        Parameters:
        token - Any token.
        Returns:
        The argument unchanged, if it was a ConceptToken.
      • getTokenClass

        public java.lang.Class<ConceptToken> getTokenClass()
        Return the class for tokens that this type represents.
        Specified by:
        getTokenClass in interface Type
        Returns:
        ConceptToken.class
      • isCompatible

        public boolean isCompatible​(Type type)
        Test if the argument is compatible with this type.
        Specified by:
        isCompatible in interface Type
        Parameters:
        type - A type.
        Returns:
        True if it is a ConceptType.
      • isConstant

        public boolean isConstant()
        Test if this type is constant.
        Specified by:
        isConstant in interface Type
        Returns:
        True.
      • isInstantiable

        public boolean isInstantiable()
        Test if this Type corresponds to an instantiable token class.
        Specified by:
        isInstantiable in interface Type
        Returns:
        True.
      • isSubstitutionInstance

        public boolean isSubstitutionInstance​(Type type)
        Detect if the specified type is a substitution instance of this type.
        Specified by:
        isSubstitutionInstance in interface Type
        Parameters:
        type - A type to check.
        Returns:
        True, if the given type is equal to ConceptType.
      • clone

        public ConceptType clone()
        Do nothing, since this is a singleton type.
        Specified by:
        clone in interface Type
        Specified by:
        clone in class StructuredType
        Returns:
        The instance being cloned.
      • initialize

        public void initialize​(Type type)
        Do nothing, since there are no unknown subtypes.
        Specified by:
        initialize in class StructuredType
        Parameters:
        type - Ignored.
      • _compare

        protected int _compare​(StructuredType type)
        Compare this type with the specified type.
        Specified by:
        _compare in class StructuredType
        Parameters:
        type - Another instance of the ConceptType singleton type.
        Returns:
        CPO.SAME, since this is a singleton type.
      • _greatestLowerBound

        protected StructuredType _greatestLowerBound​(StructuredType type)
        Take the greatest lower bound of this type with the specified type.
        Specified by:
        _greatestLowerBound in class StructuredType
        Parameters:
        type - Another instance of the ConceptType singleton type.
        Returns:
        The unique representative of this singleton type.
      • _leastUpperBound

        protected StructuredType _leastUpperBound​(StructuredType type)
        Take the least upper bound of this type with the specified type.
        Specified by:
        _leastUpperBound in class StructuredType
        Parameters:
        type - Another instance of the ConceptType singleton type.
        Returns:
        The unique representative of this singleton type.