Package ptolemy.data.ontologies
Class ConceptType
- java.lang.Object
-
- ptolemy.data.type.StructuredType
-
- ptolemy.data.ontologies.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 Summary
Fields Modifier and Type Field Description static ConceptType
CONCEPT
The representative type for all ConceptTokens.-
Fields inherited from class ptolemy.data.type.StructuredType
MAXDEPTHBOUND
-
Fields inherited from interface ptolemy.data.type.Type
HASH_INVALID
-
-
Constructor Summary
Constructors Constructor Description ConceptType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
_compare(StructuredType type)
Compare this type with the specified type.protected StructuredType
_getRepresentative()
Return the representative of this type.protected StructuredType
_greatestLowerBound(StructuredType type)
Take the greatest lower bound of this type with the specified type.protected StructuredType
_leastUpperBound(StructuredType type)
Take the least upper bound of this type with the specified type.ConceptType
clone()
Do nothing, since this is a singleton type.ConceptToken
convert(Token token)
Convert the specified token into a ConceptToken.java.lang.Class<ConceptToken>
getTokenClass()
Return the class for tokens that this type represents.void
initialize(Type type)
Do nothing, since there are no unknown subtypes.boolean
isCompatible(Type type)
Test if the argument is compatible with this type.boolean
isConstant()
Test if this type is constant.boolean
isInstantiable()
Test if this Type corresponds to an instantiable token class.boolean
isSubstitutionInstance(Type type)
Detect if the specified type is a substitution instance of this type.-
Methods inherited from class ptolemy.data.type.StructuredType
add, depth, divide, getTypeHash, isAbstract, modulo, multiply, one, subtract, updateType, zero
-
-
-
-
Field Detail
-
CONCEPT
public static final ConceptType CONCEPT
The representative type for all ConceptTokens.
-
-
Method Detail
-
convert
public ConceptToken convert(Token token)
Convert the specified token into a ConceptToken.
-
getTokenClass
public java.lang.Class<ConceptToken> getTokenClass()
Return the class for tokens that this type represents.- Specified by:
getTokenClass
in interfaceType
- Returns:
- ConceptToken.class
-
isCompatible
public boolean isCompatible(Type type)
Test if the argument is compatible with this type.- Specified by:
isCompatible
in interfaceType
- 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 interfaceType
- Returns:
- True.
-
isInstantiable
public boolean isInstantiable()
Test if this Type corresponds to an instantiable token class.- Specified by:
isInstantiable
in interfaceType
- Returns:
- True.
-
isSubstitutionInstance
public boolean isSubstitutionInstance(Type type)
Detect if the specified type is a substitution instance of this type.- Specified by:
isSubstitutionInstance
in interfaceType
- 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 interfaceType
- Specified by:
clone
in classStructuredType
- Returns:
- The instance being cloned.
-
initialize
public void initialize(Type type)
Do nothing, since there are no unknown subtypes.- Specified by:
initialize
in classStructuredType
- Parameters:
type
- Ignored.
-
_compare
protected int _compare(StructuredType type)
Compare this type with the specified type.- Specified by:
_compare
in classStructuredType
- Parameters:
type
- Another instance of the ConceptType singleton type.- Returns:
- CPO.SAME, since this is a singleton type.
-
_getRepresentative
protected StructuredType _getRepresentative()
Return the representative of this type.- Specified by:
_getRepresentative
in classStructuredType
- Returns:
- The unique representative of this singleton type.
-
_greatestLowerBound
protected StructuredType _greatestLowerBound(StructuredType type)
Take the greatest lower bound of this type with the specified type.- Specified by:
_greatestLowerBound
in classStructuredType
- 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 classStructuredType
- Parameters:
type
- Another instance of the ConceptType singleton type.- Returns:
- The unique representative of this singleton type.
-
-