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 ConceptTypeCONCEPTThe 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.ConceptTypeclone()Do nothing, since this is a singleton type.ConceptTokenconvert(Token token)Convert the specified token into a ConceptToken.java.lang.Class<ConceptToken>getTokenClass()Return the class for tokens that this type represents.voidinitialize(Type type)Do nothing, since there are no unknown subtypes.booleanisCompatible(Type type)Test if the argument is compatible with this type.booleanisConstant()Test if this type is constant.booleanisInstantiable()Test if this Type corresponds to an instantiable token class.booleanisSubstitutionInstance(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:
getTokenClassin interfaceType- Returns:
- ConceptToken.class
-
isCompatible
public boolean isCompatible(Type type)
Test if the argument is compatible with this type.- Specified by:
isCompatiblein interfaceType- Parameters:
type- A type.- Returns:
- True if it is a ConceptType.
-
isConstant
public boolean isConstant()
Test if this type is constant.- Specified by:
isConstantin interfaceType- Returns:
- True.
-
isInstantiable
public boolean isInstantiable()
Test if this Type corresponds to an instantiable token class.- Specified by:
isInstantiablein interfaceType- Returns:
- True.
-
isSubstitutionInstance
public boolean isSubstitutionInstance(Type type)
Detect if the specified type is a substitution instance of this type.- Specified by:
isSubstitutionInstancein 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:
clonein interfaceType- Specified by:
clonein classStructuredType- Returns:
- The instance being cloned.
-
initialize
public void initialize(Type type)
Do nothing, since there are no unknown subtypes.- Specified by:
initializein classStructuredType- Parameters:
type- Ignored.
-
_compare
protected int _compare(StructuredType type)
Compare this type with the specified type.- Specified by:
_comparein 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:
_getRepresentativein 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:
_greatestLowerBoundin 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:
_leastUpperBoundin classStructuredType- Parameters:
type- Another instance of the ConceptType singleton type.- Returns:
- The unique representative of this singleton type.
-
-