Package ptolemy.data.ontologies
Class ConceptToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.data.ObjectToken
-
- ptolemy.data.ontologies.ConceptToken
-
- All Implemented Interfaces:
PartiallyOrderedToken
public class ConceptToken extends ObjectToken implements PartiallyOrderedToken
A token that contains an ontology concept. Concepts are partially ordered immutable values that belong to an ontology. Most of the functionality of this token class is is simply inherited from Concept.Concept- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ben Lickly
- Pt.AcceptedRating:
- Red (blickly)
- Pt.ProposedRating:
- Red (blickly)
-
-
Constructor Summary
Constructors Constructor Description ConceptToken(Concept c)Create a ConceptToken from a given Concept.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConceptconceptValue()Return the concept encapsulated by this token.ConceptTypegetType()Return the type of this token.BooleanTokenisEqualTo(Token rightArgument)Compare this ConceptToken to the given argument, and return true if they refer to the same concept in the same lattice.BooleanTokenisLessThan(PartiallyOrderedToken rightArgument)Check whether the value of this token is strictly less than that of the argument token.java.lang.StringtoString()Return the value of this concept token as a string.-
Methods inherited from class ptolemy.data.ObjectToken
_isCloseTo, _isEqualTo, convert, equals, getValue, getValueClass, hashCode, isCloseTo, object
-
Methods inherited from class ptolemy.data.Token
add, addReverse, divide, divideReverse, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType
-
-
-
-
Constructor Detail
-
ConceptToken
public ConceptToken(Concept c) throws IllegalActionException
Create a ConceptToken from a given Concept.- Parameters:
c- The given Concept- Throws:
IllegalActionException- Thrown if there is a problem creating the ConceptTolen object.
-
-
Method Detail
-
conceptValue
public Concept conceptValue()
Return the concept encapsulated by this token.- Returns:
- The concept value.
-
getType
public ConceptType getType()
Return the type of this token.- Overrides:
getTypein classObjectToken- Returns:
- ConceptType.CONCEPT
-
isEqualTo
public BooleanToken isEqualTo(Token rightArgument)
Compare this ConceptToken to the given argument, and return true if they refer to the same concept in the same lattice. If either is null, return false.- Overrides:
isEqualToin classObjectToken- Parameters:
rightArgument- The argument.- Returns:
- true if the values are the same Concept, or false otherwise.
-
isLessThan
public BooleanToken isLessThan(PartiallyOrderedToken rightArgument) throws IllegalActionException
Check whether the value of this token is strictly less than that of the argument token. Note that ontologies are only partial orders, so !(a < b) does not imply (a ≥ b).- Specified by:
isLessThanin interfacePartiallyOrderedToken- Parameters:
rightArgument- The token on greater than side of the inequality.- Returns:
- BooleanToken.TRUE, if this token is less than the argument token. BooleanToken.FALSE, otherwise.
- Throws:
IllegalActionException- If the argument token and this token are of incomparable types, or are concepts from different ontologies.
-
toString
public java.lang.String toString()
Return the value of this concept token as a string.- Overrides:
toStringin classObjectToken- Returns:
- The name of the concept contained by this token as a string value.
-
-