GATE
Version 3.1-2270

gate.creole.ontology
Class TClassImpl

java.lang.Object
  extended by gate.creole.ontology.OntologyResourceImpl
      extended by gate.creole.ontology.TClassImpl
All Implemented Interfaces:
OntologyConstants, OntologyResource, TClass
Direct Known Subclasses:
OClassImpl

public class TClassImpl
extends OntologyResourceImpl
implements TClass

Represents a single ontology class.


Field Summary
 
Fields inherited from class gate.creole.ontology.OntologyResourceImpl
comment, instanceProperties, name, ontology, taxonomy, uri
 
Fields inherited from interface gate.creole.ontology.OntologyConstants
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 resource.
 String getId()
          Gets the id of the class.
 String getName()
          Gets resource name.
 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.
 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 resource comment.
 void setName(String aName)
          Sets the resource name.
 void setURI(String theURI)
          Sets the URI of the resource.
 String toString()
          Dumps the class to string.
 
Methods inherited from class gate.creole.ontology.OntologyResourceImpl
addPropertyValue, getOntology, getPropertyValue, getPropertyValues, getSetPropertiesNames, getTaxonomy, getURI, removePropertyValue, removePropertyValues, setOntology
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.creole.ontology.OntologyResource
addPropertyValue, getOntology, getPropertyValues, getSetPropertiesNames, getTaxonomy, getURI, removePropertyValue, removePropertyValues
 

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

setURI

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

Specified by:
setURI in interface OntologyResource
Overrides:
setURI in class OntologyResourceImpl
Parameters:
theURI - The URI to set.

getComment

public String getComment()
Description copied from interface: OntologyResource
Gets the comment of the resource.

Specified by:
getComment in interface OntologyResource
Overrides:
getComment in class OntologyResourceImpl
Returns:
Returns the comment.

setComment

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

Specified by:
setComment in interface OntologyResource
Overrides:
setComment in class OntologyResourceImpl
Parameters:
aComment - The comment to set.

getName

public String getName()
Description copied from interface: OntologyResource
Gets resource name.

Specified by:
getName in interface OntologyResource
Overrides:
getName in class OntologyResourceImpl
Returns:
Returns the name.

setName

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

Specified by:
setName in interface OntologyResource
Overrides:
setName in class OntologyResourceImpl
Parameters:
aName - The name to set.

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)
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

getSuperClasses

public Set getSuperClasses(byte closure)
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

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
Overrides:
toString in class Object
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: 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
Overrides:
equals in class Object
Parameters:
o - the ontology class to be tested versus this one.
Returns:
true, if the classes are equal, otherwise - false.

GATE
Version 3.1-2270