notio
Class ConceptTypeHierarchy

java.lang.Object
  |
  +--notio.TypeHierarchy
        |
        +--notio.ConceptTypeHierarchy

public class ConceptTypeHierarchy
extends notio.TypeHierarchy
implements java.io.Serializable

The concept type hierarchy class.

See Also:
Serialized Form

Field Summary
static java.lang.String ABSURD_TYPE_LABEL
          The predefined type label for the absurd type.
static java.lang.String UNIVERSAL_TYPE_LABEL
          The predefined type label for the universal type.
 
Constructor Summary
ConceptTypeHierarchy()
          Constructs a new concept type hierarchy.
 
Method Summary
 void addSubTypesToType(ConceptType subjectType, ConceptType[] newSubTypes)
          Adds the specified list of subtypes as sub types to the subject type.
 void addSubTypeToType(ConceptType subjectType, ConceptType newSubType)
          Adds the specified subtype to the subject type.
 void addSuperTypesToType(ConceptType subjectType, ConceptType[] newSuperTypes)
          Adds the specified list of supertypes as super types to the subject type.
 void addSuperTypeToType(ConceptType subjectType, ConceptType newSuperType)
          Adds the specified supertype to the subject type.
 void addTypeToHierarchy(ConceptType newType)
          Adds a new type to this hierarchy with the Universal type as its only supertype, and the Absurd type as its only subtype.
 void addTypeToHierarchy(ConceptType newType, ConceptType[] supertypes, ConceptType[] subtypes)
          Adds a new type to the hierarchy with the specified supertypes and subtypes.
 void addTypeToHierarchy(ConceptType newType, ConceptType supertype, ConceptType subtype)
          Adds a new type to this hierarchy with the specified supertype and subtype.
 boolean getCaseSensitiveLabels()
          Returns true if the processing of type labels in this hierarchy is case-sensitive.
 ConceptType[] getImmediateSubTypesOf(ConceptType subjectType)
          Returns the immediate subtypes of the subject type in no particular order.
 ConceptType[] getImmediateSuperTypesOf(ConceptType subjectType)
          Returns the immediate subtypes of the subject type in no particular order.
 ConceptType[] getProperSubTypesOf(ConceptType subjectType)
          Returns all the subtypes of the subject type, not just the immediate subtypes, in no particular order.
 ConceptType[] getProperSuperTypesOf(ConceptType subjectType)
          Returns all the supertypes of the subject type, not just the immediate supertypes, in no particular order.
 ConceptType getTypeByLabel(java.lang.String label)
          Looks up and returns the type object associated with the specified label.
 ConceptType[] getUnlabelledTypes()
          Returns all unlabelled types in this hierarchy in no particular order.
 boolean isProperSubTypeOf(ConceptType subject, ConceptType object)
          Determines whether subject is a subtype of object.
 boolean isProperSuperTypeOf(ConceptType subject, ConceptType object)
          Determines whether subject is a proper supertype of object.
 boolean isSubTypeOf(ConceptType subject, ConceptType object)
          Determines whether subject is a subtype of object.
 boolean isSuperTypeOf(ConceptType subject, ConceptType object)
          Determines whether subject is a supertype of object.
 void removeTypeFromHierarchy(ConceptType deadType)
          Removes a type from this hierarchy.
 void setCaseSensitiveLabels(boolean flag)
          Sets a flag indicating whether or not the processing of type labels within this hierarchy is case-sensitive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIVERSAL_TYPE_LABEL

public static final java.lang.String UNIVERSAL_TYPE_LABEL
The predefined type label for the universal type.

ABSURD_TYPE_LABEL

public static final java.lang.String ABSURD_TYPE_LABEL
The predefined type label for the absurd type.
Constructor Detail

ConceptTypeHierarchy

public ConceptTypeHierarchy()
Constructs a new concept type hierarchy.
Method Detail

addTypeToHierarchy

public void addTypeToHierarchy(ConceptType newType,
                               ConceptType[] supertypes,
                               ConceptType[] subtypes)
                        throws TypeAddError,
                               TypeChangeError
Adds a new type to the hierarchy with the specified supertypes and subtypes.
Parameters:
newType - the type being added.
supertypes - the array of supertypes to be used, or null (assumes universal type as only supertype).
subtypes - the array of subtypes to be used, or null (assumes absurd type as only subtype).
Throws:
TypeAddError - if type label is already in use by another type.
TypeChangeError - if specified supertypes or subtypes are not in hierarchy, or if addition of type creates a type order conflict.

addTypeToHierarchy

public void addTypeToHierarchy(ConceptType newType,
                               ConceptType supertype,
                               ConceptType subtype)
                        throws TypeAddError,
                               TypeChangeError
Adds a new type to this hierarchy with the specified supertype and subtype.
Parameters:
newType - the type being added.
supertype - the single supertype to be used, or null (assumes universal type as subtype).
subtype - the single subtype to be used, or null (assumes absurd type as subtype).
Throws:
TypeAddError - if type label is already in use by another type.
TypeChangeError - if specified supertypes or subtypes are not in hierarchy, or if addition of a type creates a type order conflict.

addTypeToHierarchy

public void addTypeToHierarchy(ConceptType newType)
                        throws TypeAddError
Adds a new type to this hierarchy with the Universal type as its only supertype, and the Absurd type as its only subtype. Note that unlike the other versions of this method, this does not throw notio.TypeChangeError since the Universal and Absurd types are always present in the hierarchy.
Parameters:
newType - the type being added.
Throws:
TypeAddError - if type label is already in use by another type.

addSuperTypesToType

public void addSuperTypesToType(ConceptType subjectType,
                                ConceptType[] newSuperTypes)
                         throws TypeChangeError
Adds the specified list of supertypes as super types to the subject type.
Parameters:
subjectType - the type having supertypes added.
newSuperTypes - the array of types to be added as supertypes.
Throws:
TypeChangeError - if specified supertypes are not in hierarchy, or if addition of supertypes creates a type order conflict.

addSuperTypeToType

public void addSuperTypeToType(ConceptType subjectType,
                               ConceptType newSuperType)
                        throws TypeChangeError
Adds the specified supertype to the subject type.
Parameters:
subjectType - the type having a supertype added.
newSuperType - the supertype to be added.
Throws:
TypeChangeError - if specified supertype is not in hierarchy or, if addition of the supertype creates a type order conflict.

addSubTypesToType

public void addSubTypesToType(ConceptType subjectType,
                              ConceptType[] newSubTypes)
                       throws TypeChangeError
Adds the specified list of subtypes as sub types to the subject type.
Parameters:
subjectType - the type having subtypes added.
newSubTypes - the array of types to be added as subtypes.
Throws:
TypeChangeError - if specified subtypes are not in hierarchy, or if addition of subtypes creates a type order conflict.

addSubTypeToType

public void addSubTypeToType(ConceptType subjectType,
                             ConceptType newSubType)
                      throws TypeChangeError
Adds the specified subtype to the subject type.
Parameters:
subjectType - the type having a subtype added.
newSubType - the subtype to be added.
Throws:
TypeChangeError - if specified subtype is not in hierarchy or, if addition of the subtype creates a type order conflict.

removeTypeFromHierarchy

public void removeTypeFromHierarchy(ConceptType deadType)
                             throws TypeRemoveError
Removes a type from this hierarchy.
Parameters:
deadType - the type being removed.
Throws:
TypeRemoveError - if specified type is not in hierarchy

getTypeByLabel

public ConceptType getTypeByLabel(java.lang.String label)
Looks up and returns the type object associated with the specified label.
Parameters:
label - the label used to lookup.
Returns:
the type associated with the label or null if non-existant.

getUnlabelledTypes

public ConceptType[] getUnlabelledTypes()
Returns all unlabelled types in this hierarchy in no particular order.
Returns:
an array of the unlabelled types in this hierarchy, possibly empty.

getProperSuperTypesOf

public ConceptType[] getProperSuperTypesOf(ConceptType subjectType)
Returns all the supertypes of the subject type, not just the immediate supertypes, in no particular order.
Parameters:
subjectType - the type whose supertypes will be returned.
Returns:
an array of the supertypes of the parent type, possibly empty.

getProperSubTypesOf

public ConceptType[] getProperSubTypesOf(ConceptType subjectType)
Returns all the subtypes of the subject type, not just the immediate subtypes, in no particular order.
Parameters:
subjectType - the type whose subtypes will be returned.
Returns:
an array of the subtypes of the subject type, possibly empty.

getImmediateSuperTypesOf

public ConceptType[] getImmediateSuperTypesOf(ConceptType subjectType)
Returns the immediate subtypes of the subject type in no particular order.
Parameters:
subjectType - the type whose immediate subtypes will be returned.
Returns:
an array of the immediate subtypes of the subject type, possibly empty.

getImmediateSubTypesOf

public ConceptType[] getImmediateSubTypesOf(ConceptType subjectType)
Returns the immediate subtypes of the subject type in no particular order.
Parameters:
subjectType - the type whose immediate subtypes will be returned.
Returns:
an array of the immediate subtypes of the subject type, possibly empty.

isSubTypeOf

public boolean isSubTypeOf(ConceptType subject,
                           ConceptType object)
Determines whether subject is a subtype of object.
Parameters:
subject - the potential subtype being tested.
object - the potential supertype being tested.
Returns:
true if subject is a subtype of object.

isSuperTypeOf

public boolean isSuperTypeOf(ConceptType subject,
                             ConceptType object)
Determines whether subject is a supertype of object.
Parameters:
subject - the potential supertype being tested.
object - the potential subtype being tested.
Returns:
true if subject is a supertype of object.

isProperSubTypeOf

public boolean isProperSubTypeOf(ConceptType subject,
                                 ConceptType object)
Determines whether subject is a subtype of object.
Parameters:
subject - the potential subtype being tested.
object - the potential supertype being tested.
Returns:
true if subject is a subtype of object.

isProperSuperTypeOf

public boolean isProperSuperTypeOf(ConceptType subject,
                                   ConceptType object)
Determines whether subject is a proper supertype of object.
Parameters:
subject - the potential supertype being tested.
object - the potential subtype being tested.
Returns:
true if subject is a supertype of object.

setCaseSensitiveLabels

public void setCaseSensitiveLabels(boolean flag)
Sets a flag indicating whether or not the processing of type labels within this hierarchy is case-sensitive.
Parameters:
flag - the flag setting for case-sensitivity.

getCaseSensitiveLabels

public boolean getCaseSensitiveLabels()
Returns true if the processing of type labels in this hierarchy is case-sensitive.
Returns:
true if the processing of type labels in this hierarchy is case-sensitive.


Copyright 1998-1999 Finnegan Southey