gate.creole.ontology
Class TClassImpl

java.lang.Object
  extended bygate.creole.ontology.TClassImpl
All Implemented Interfaces:
TClass
Direct Known Subclasses:
OClassImpl

public class TClassImpl
extends Object
implements TClass

Represents a single ontology class.


Field Summary
 
Fields inherited from interface gate.creole.ontology.TClass
DIRECT_CLOSURE, TRANSITIVE_CLOSURE
 
Constructor Summary
TClassImpl(String anId, String aName, String aComment, Taxonomy anOntology)
          Creates a new class given id,name,comment and ontology.
 
Method Summary
 void addSubClass(TClass subClass)
          Adds a sub class to this class.
 void addSuperClass(TClass superClass)
          Adds a super class to this class.
 boolean equals(Object o)
          Checks the equality of two classes.
 String getComment()
          Gets the comment of the class.
 String getId()
          Gets the id of the class.
 String getName()
          Gets class name.
 Taxonomy getOntology()
          Gets the ontology to which this class is associated.
 Set getSubClasses(byte closure)
          Gets the subclasses according to the desired closure.
static Set getSubClasses(byte closure, Set classes)
           
 ArrayList getSubClassesVSDistance()
          Gets the sub classes, and returns them in an array list where on each index there is a collection of the sub classes at distance - the index.
 Set getSuperClasses(byte closure)
          Gets the super classes according to the desired closure.
static Set getSuperClasses(byte closure, Set classes)
           
 ArrayList getSuperClassesVSDistance()
          Gets the super classes, and returns them in an array list where on each index there is a collection of the super classes at distance - the index.
 String getURI()
          Gets the URI of the class.
 void inferSubClassesTransitiveClosure()
          Infers the sub classes transitive closure.
 void inferSuperClassesTransitiveClosure()
          Infers the super classes transitive closure.
 boolean isTopClass()
          Checks whether this class is a top.
 void removeSubClass(TClass subClass)
          Removes a sub class.
 void removeSuperClass(TClass superClass)
          Removes a super class.
 void setComment(String aComment)
          Sets the class comment.
 void setName(String aName)
          Sets the class name.
 void setURI(String theURI)
          Sets the URI of the class.
 String toString()
          Dumps the class to string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TClassImpl

public TClassImpl(String anId,
                  String aName,
                  String aComment,
                  Taxonomy anOntology)
Creates a new class given id,name,comment and ontology.

Parameters:
anId - the id of the new class
aName - the name of the new class
aComment - the comment of the new class
anOntology - the ontology to which the new class belongs
Method Detail

getId

public String getId()
Gets the id of the class.

Specified by:
getId in interface TClass
Returns:
the id of the class

getOntology

public Taxonomy getOntology()
Gets the ontology to which this class is associated.

Specified by:
getOntology in interface TClass
Returns:
the ontology to which this class is associated.

getURI

public String getURI()
Description copied from interface: TClass
Gets the URI of the class.

Specified by:
getURI in interface TClass
Returns:
the URI of the class

setURI

public void setURI(String theURI)
Description copied from interface: TClass
Sets the URI of the class.

Specified by:
setURI in interface TClass
Parameters:
theURI - the new URI to be set

getComment

public String getComment()
Description copied from interface: TClass
Gets the comment of the class.

Specified by:
getComment in interface TClass
Returns:
the comment of the class

setComment

public void setComment(String aComment)
Description copied from interface: TClass
Sets the class comment.

Specified by:
setComment in interface TClass
Parameters:
aComment - the comment to be set

getName

public String getName()
Description copied from interface: TClass
Gets class name.

Specified by:
getName in interface TClass
Returns:
the name of the class

setName

public void setName(String aName)
Description copied from interface: TClass
Sets the class name.

Specified by:
setName in interface TClass
Parameters:
aName - the new name of the class

addSubClass

public void addSubClass(TClass subClass)
Description copied from interface: TClass
Adds a sub class to this class.

Specified by:
addSubClass in interface TClass
Parameters:
subClass - the subClass to be added.

addSuperClass

public void addSuperClass(TClass superClass)
Description copied from interface: TClass
Adds a super class to this class.

Specified by:
addSuperClass in interface TClass
Parameters:
superClass - the super class to be added

removeSubClass

public void removeSubClass(TClass subClass)
Description copied from interface: TClass
Removes a sub class.

Specified by:
removeSubClass in interface TClass
Parameters:
subClass - the sub class to be removed

removeSuperClass

public void removeSuperClass(TClass superClass)
Description copied from interface: TClass
Removes a super class.

Specified by:
removeSuperClass in interface TClass
Parameters:
superClass - the super class to be removed

getSubClasses

public Set getSubClasses(byte closure)
                  throws NoSuchClosureTypeException
Description copied from interface: TClass
Gets the subclasses according to the desired closure.

Specified by:
getSubClasses in interface TClass
Parameters:
closure - either DIRECT_CLOSURE or TRASITIVE_CLOSURE
Returns:
the set of subclasses
Throws:
NoSuchClosureTypeException - if an unknown closure is specified.

getSuperClasses

public Set getSuperClasses(byte closure)
                    throws NoSuchClosureTypeException
Description copied from interface: TClass
Gets the super classes according to the desired closure.

Specified by:
getSuperClasses in interface TClass
Parameters:
closure - either DIRECT_CLOSURE or TRASITIVE_CLOSURE
Returns:
the set of super classes
Throws:
NoSuchClosureTypeException - if an unknown closure is specified.

inferSubClassesTransitiveClosure

public void inferSubClassesTransitiveClosure()
Description copied from interface: TClass
Infers the sub classes transitive closure.

Specified by:
inferSubClassesTransitiveClosure in interface TClass

inferSuperClassesTransitiveClosure

public void inferSuperClassesTransitiveClosure()
Description copied from interface: TClass
Infers the super classes transitive closure.

Specified by:
inferSuperClassesTransitiveClosure in interface TClass

isTopClass

public boolean isTopClass()
Description copied from interface: TClass
Checks whether this class is a top.

Specified by:
isTopClass in interface TClass
Returns:
true if this is a top class, otherwise - false.

toString

public String toString()
Description copied from interface: TClass
Dumps the class to string.

Specified by:
toString in interface TClass

getSubClasses

public static Set getSubClasses(byte closure,
                                Set classes)

getSuperClasses

public static Set getSuperClasses(byte closure,
                                  Set classes)

getSubClassesVSDistance

public ArrayList getSubClassesVSDistance()
Description copied from interface: TClass
Gets the sub classes, and returns them in an array list where on each index there is a collection of the sub classes at distance - the index.

Specified by:
getSubClassesVSDistance in interface TClass
Returns:
distance from this class to a set of sub classes e.g. 1 : a,b 2 : c,d

getSuperClassesVSDistance

public ArrayList getSuperClassesVSDistance()
Description copied from interface: TClass
Gets the super classes, and returns them in an array list where on each index there is a collection of the super classes at distance - the index.

Specified by:
getSuperClassesVSDistance in interface TClass
Returns:
distance from this class to a set of super classes e.g. 1 : a,b 2 : c,d

equals

public boolean equals(Object o)
Description copied from interface: TClass
Checks the equality of two classes.

Specified by:
equals in interface TClass