ptolemy.actor.lib.security
Class KeyToken.KeyType

java.lang.Object
  extended byptolemy.actor.lib.security.KeyToken.KeyType
All Implemented Interfaces:
java.io.Serializable, ptolemy.data.type.Type
Enclosing class:
KeyToken

public static class KeyToken.KeyType
extends java.lang.Object
implements ptolemy.data.type.Type, java.io.Serializable

The cryptographic key type.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface ptolemy.data.type.Type
HASH_INVALID, HASH_MAX
 
Method Summary
 java.lang.Object clone()
          Return this, that is, return the reference to this object.
 ptolemy.data.Token convert(ptolemy.data.Token token)
          Convert the specified token to a token having the type represented by this object.
 java.lang.Class getTokenClass()
          Return the class for tokens that this basetype represents.
 int getTypeHash()
          Return this type's node index in the (constant) type lattice.
 boolean isCompatible(ptolemy.data.type.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(ptolemy.data.type.Type type)
          Return true if the argument is a substitution instance of this type.
 java.lang.String toString()
          Return the string representation 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
 

Method Detail

clone

public java.lang.Object clone()
Return this, that is, return the reference to this object.

Specified by:
clone in interface ptolemy.data.type.Type
Returns:
A KeyType

convert

public ptolemy.data.Token convert(ptolemy.data.Token token)
                           throws ptolemy.kernel.util.IllegalActionException
Convert the specified token to a token having the type represented by this object.

Specified by:
convert in interface ptolemy.data.type.Type
Parameters:
token - A token.
Returns:
A token.
Throws:
ptolemy.kernel.util.IllegalActionException - If lossless conversion cannot be done.

getTokenClass

public java.lang.Class getTokenClass()
Return the class for tokens that this basetype represents.

Specified by:
getTokenClass in interface ptolemy.data.type.Type

isCompatible

public boolean isCompatible(ptolemy.data.type.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 ptolemy.data.type.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 ptolemy.data.type.Type
Returns:
True if this Type is not UNKNOWN; false otherwise.

getTypeHash

public int getTypeHash()
Return this type's node index in the (constant) type lattice.

Specified by:
getTypeHash in interface ptolemy.data.type.Type
Returns:
this type's node 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 ptolemy.data.type.Type
Returns:
True if this type is instantiable.

isSubstitutionInstance

public boolean isSubstitutionInstance(ptolemy.data.type.Type type)
Return true if the argument is a substitution instance of this type.

Specified by:
isSubstitutionInstance in interface ptolemy.data.type.Type
Parameters:
type - A Type.
Returns:
True if this type is UNKNOWN; false otherwise.

toString

public java.lang.String toString()
Return the string representation of this type.

Specified by:
toString in interface ptolemy.data.type.Type
Returns:
A String.