notio
Class ConceptType

java.lang.Object
  |
  +--notio.Type
        |
        +--notio.ConceptType

public class ConceptType
extends notio.Type
implements java.io.Serializable

The concept type class. This class encapsulates all available information about a concept type. The type can be defined by a label and/or a type definition.

See Also:
Serialized Form

Constructor Summary
ConceptType(ConceptTypeDefinition newDefinition)
          Constructs an unlabelled ConceptType with the specified type definition.
ConceptType(java.lang.String newLabel)
          Constructs a labelled ConceptType with the specified type label and no type definition.
ConceptType(java.lang.String newLabel, ConceptTypeDefinition newDefinition)
          Constructs a labelled ConceptType with the specified type label and type definition.
 
Method Summary
 java.lang.String getComment()
          Returns the comment string for this type.
 ConceptType[] getImmediateSubTypes()
          Returns the immediate subtypes of this type.
 ConceptType[] getImmediateSuperTypes()
          Returns the immediate supertypes of this type.
 java.lang.String getLabel()
          Returns the type label for this type.
 ConceptType[] getProperSubTypes()
          Returns all subtypes of this type.
 ConceptType[] getProperSuperTypes()
          Returns all supertypes of this type.
 ConceptTypeDefinition getTypeDefinition()
          Returns the type definition for this type (if any).
 boolean hasProperSubType(ConceptType queryType)
          Tests whether the specified type is a proper subtype of this type.
 boolean hasProperSuperType(ConceptType queryType)
          Tests whether the specified type is a proper supertype of this type.
 boolean hasSubType(ConceptType queryType)
          Tests whether the specified type is a subtype of this type.
 boolean hasSuperType(ConceptType queryType)
          Tests whether the specified type is a supertype of this type.
static boolean matchConceptTypes(ConceptType first, ConceptType second, MatchingScheme matchingScheme)
          Compares two concept types to decide if they match.
 void setComment(java.lang.String newComment)
          Sets the comment string for this type.
 void setLabel(java.lang.String newLabel)
          Sets the type label for this type.
 void setTypeDefinition(ConceptTypeDefinition newDefinition)
          Sets the type definition for this type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConceptType

public ConceptType(java.lang.String newLabel,
                   ConceptTypeDefinition newDefinition)
Constructs a labelled ConceptType with the specified type label and type definition. NOTE: This does not add the type to any hierarchy.
Parameters:
newLabel - the type label for this type.
newDefinition - the type definition for this type.

ConceptType

public ConceptType(java.lang.String newLabel)
Constructs a labelled ConceptType with the specified type label and no type definition. NOTE: This does not add the type to any hierarchy.
Parameters:
newLabel - the type label for this type.

ConceptType

public ConceptType(ConceptTypeDefinition newDefinition)
Constructs an unlabelled ConceptType with the specified type definition. NOTE: This does not add the type to any hierarchy.
Parameters:
newDefinition - the type definition for this type.
Method Detail

setLabel

public void setLabel(java.lang.String newLabel)
              throws TypeChangeError
Sets the type label for this type. If the type already had a label, it is replaced. If a null is used, the label is removed from the type.
Parameters:
newLabel - the string that is the label for this type.
Throws:
TypeChangeError - if the type belongs to a hierarchy and the new label is already in use within it.

getLabel

public java.lang.String getLabel()
Returns the type label for this type.
Returns:
the string that is the label for this type.
Overrides:
getLabel in class notio.Type

setTypeDefinition

public void setTypeDefinition(ConceptTypeDefinition newDefinition)
Sets the type definition for this type. If the type already has a definition, it is replaced. If null is used, the type definition will be removed.
Parameters:
newDefinition - the new type definition for this type.

getTypeDefinition

public ConceptTypeDefinition getTypeDefinition()
Returns the type definition for this type (if any).
Returns:
the type definition for this type or null if there isn't one.

getProperSubTypes

public ConceptType[] getProperSubTypes()
Returns all subtypes of this type.
Returns:
an array of subtypes of this type.

getProperSuperTypes

public ConceptType[] getProperSuperTypes()
Returns all supertypes of this type.
Returns:
an array of supertypes of this type.

getImmediateSubTypes

public ConceptType[] getImmediateSubTypes()
Returns the immediate subtypes of this type.
Returns:
an array of immediate subtypes of this type.

getImmediateSuperTypes

public ConceptType[] getImmediateSuperTypes()
Returns the immediate supertypes of this type.
Returns:
an array of immediate supertypes of this type.

hasSubType

public boolean hasSubType(ConceptType queryType)
Tests whether the specified type is a subtype of this type.
Parameters:
queryType - the type being tested.
Returns:
true if queryType is a subtype of this type, false otherwise.

hasSuperType

public boolean hasSuperType(ConceptType queryType)
Tests whether the specified type is a supertype of this type.
Parameters:
queryType - the type being tested.
Returns:
true if queryType is a supertype of this type, false otherwise.

hasProperSubType

public boolean hasProperSubType(ConceptType queryType)
Tests whether the specified type is a proper subtype of this type.
Parameters:
queryType - the type being tested.
Returns:
true if queryType is a proper subtype of this type, false otherwise.

hasProperSuperType

public boolean hasProperSuperType(ConceptType queryType)
Tests whether the specified type is a proper supertype of this type.
Parameters:
queryType - the type being tested.
Returns:
true if queryType is a proper supertype of this type, false otherwise.

matchConceptTypes

public static boolean matchConceptTypes(ConceptType first,
                                        ConceptType second,
                                        MatchingScheme matchingScheme)
Compares two concept types to decide if they match. The exact semantics of matching are determined by the match control flag.
Parameters:
first - the first concept type being matched.
second - the second concept type being matched.
matchingScheme - the matching scheme that determines how the match is performed.
Returns:
true if the two concept types match according to the scheme's criteria.

setComment

public void setComment(java.lang.String newComment)
Sets the comment string for this type.
Parameters:
newComment - the new comment string for this type.

getComment

public java.lang.String getComment()
Returns the comment string for this type.
Returns:
the comment string associated with this type or null.


Copyright 1998-1999 Finnegan Southey