gate.creole.ontology
Class OClassImpl

java.lang.Object
  |
  +--gate.creole.ontology.OClassImpl
All Implemented Interfaces:
OClass

public class OClassImpl
extends Object
implements OClass

Represents a single ontology class.


Field Summary
(package private)  String comment
          the comment of the class
(package private)  Set directSubClasses
          the set of direct sub classes of this class
(package private)  Set directSuperClasses
          the set of direct super classes of this class
(package private)  String id
          the id of the class
(package private)  String name
          the name of the class
(package private)  Ontology ontology
          the ontology to which the class belongs
(package private)  Set subClassesTransitiveClosure
          The sub classes transitive closure set
(package private)  Set superClassesTransitiveClosure
          The super classes transitive closure set
(package private)  String uri
          the URI of the class
 
Fields inherited from interface gate.creole.ontology.OClass
DIRECT_CLOSURE, TRANSITIVE_CLOSURE
 
Constructor Summary
OClassImpl(String anId, String aName, String aComment, Ontology anOntology)
          Creates a new class given id,name,comment and ontology.
 
Method Summary
 void addSubClass(OClass subClass)
          Adds a sub class to this class.
 void addSuperClass(OClass 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.
 Ontology 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(OClass subClass)
          Removes a sub class.
 void removeSuperClass(OClass 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, registerNatives, wait, wait, wait
 

Field Detail

ontology

Ontology ontology
the ontology to which the class belongs

uri

String uri
the URI of the class

id

String id
the id of the class

name

String name
the name of the class

comment

String comment
the comment of the class

directSubClasses

Set directSubClasses
the set of direct sub classes of this class

directSuperClasses

Set directSuperClasses
the set of direct super classes of this class

subClassesTransitiveClosure

Set subClassesTransitiveClosure
The sub classes transitive closure set

superClassesTransitiveClosure

Set superClassesTransitiveClosure
The super classes transitive closure set
Constructor Detail

OClassImpl

public OClassImpl(String anId,
                  String aName,
                  String aComment,
                  Ontology 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 OClass
Returns:
the id of the class

getOntology

public Ontology getOntology()
Gets the ontology to which this class is associated.
Specified by:
getOntology in interface OClass
Returns:
the ontology to which this class is associated.

getURI

public String getURI()
Description copied from interface: OClass
Gets the URI of the class.
Specified by:
getURI in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Returns:
the URI of the class

setURI

public void setURI(String theURI)
Description copied from interface: OClass
Sets the URI of the class.
Specified by:
setURI in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
theURI - the new URI to be set

getComment

public String getComment()
Description copied from interface: OClass
Gets the comment of the class.
Specified by:
getComment in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Returns:
the comment of the class

setComment

public void setComment(String aComment)
Description copied from interface: OClass
Sets the class comment.
Specified by:
setComment in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
aComment - the comment to be set

getName

public String getName()
Description copied from interface: OClass
Gets class name.
Specified by:
getName in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Returns:
the name of the class

setName

public void setName(String aName)
Description copied from interface: OClass
Sets the class name.
Specified by:
setName in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
aName - the new name of the class

addSubClass

public void addSubClass(OClass subClass)
Description copied from interface: OClass
Adds a sub class to this class.
Specified by:
addSubClass in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
subClass - the subClass to be added.

addSuperClass

public void addSuperClass(OClass superClass)
Description copied from interface: OClass
Adds a super class to this class.
Specified by:
addSuperClass in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
superClass - the super class to be added

removeSubClass

public void removeSubClass(OClass subClass)
Description copied from interface: OClass
Removes a sub class.
Specified by:
removeSubClass in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
subClass - the sub class to be removed

removeSuperClass

public void removeSuperClass(OClass superClass)
Description copied from interface: OClass
Removes a super class.
Specified by:
removeSuperClass in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Parameters:
superClass - the super class to be removed

getSubClasses

public Set getSubClasses(byte closure)
                  throws NoSuchClosureTypeException
Description copied from interface: OClass
Gets the subclasses according to the desired closure.
Specified by:
getSubClasses in interface OClass
Following copied from interface: gate.creole.ontology.OClass
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: OClass
Gets the super classes according to the desired closure.
Specified by:
getSuperClasses in interface OClass
Following copied from interface: gate.creole.ontology.OClass
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: OClass
Infers the sub classes transitive closure.
Specified by:
inferSubClassesTransitiveClosure in interface OClass

inferSuperClassesTransitiveClosure

public void inferSuperClassesTransitiveClosure()
Description copied from interface: OClass
Infers the super classes transitive closure.
Specified by:
inferSuperClassesTransitiveClosure in interface OClass

isTopClass

public boolean isTopClass()
Description copied from interface: OClass
Checks whether this class is a top.
Specified by:
isTopClass in interface OClass
Following copied from interface: gate.creole.ontology.OClass
Returns:
true if this is a top class, otherwise - false.

toString

public String toString()
Description copied from interface: OClass
Dumps the class to string.
Specified by:
toString in interface OClass
Overrides:
toString in class Object
Following copied from interface: gate.creole.ontology.OClass
Returns:
the string representation of the class.

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: OClass
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 OClass
Following copied from interface: gate.creole.ontology.OClass
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: OClass
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 OClass
Following copied from interface: gate.creole.ontology.OClass
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: OClass
Checks the equality of two classes.
Specified by:
equals in interface OClass
Overrides:
equals in class Object
Following copied from interface: gate.creole.ontology.OClass
Parameters:
o - the ontology class to be tested versus this one.
Returns:
true, if the classes are equal, otherwise - false.