001 /*
002 * OClass.java
003 *
004 * Niraj Aswani, 09/March/07
005 *
006 * $Id: OClass.java 11598 2009-10-13 13:44:17Z johann_p $
007 */
008 package gate.creole.ontology;
009
010 import gate.util.ClosableIterator;
011 import java.util.ArrayList;
012 import java.util.Set;
013
014 /**
015 * Each OClass (Ontology Class) represents a concept/class in ontology.
016 * It provides various methods (including and not limited) to iterate
017 * through its super and sub classes in the taxonomy hierarchy.
018 *
019 * @author Niraj Aswani
020 * @author Johann Petrak
021 *
022 */
023 public interface OClass extends OResource, OConstants {
024 /**
025 * Adds a sub class to this class.
026 *
027 * @param subClass the subClass to be added.
028 */
029 public void addSubClass(OClass subClass);
030
031 /**
032 * Removes a sub class.
033 *
034 * @param subClass the sub class to be removed
035 */
036 public void removeSubClass(OClass subClass);
037
038 /**
039 * Gets the subclasses according to the desired closure.
040 *
041 * @param closure either DIRECT_CLOSURE or TRASITIVE_CLOSURE
042 * @return the set of subclasses
043 */
044 @Deprecated
045 public Set<OClass> getSubClasses(byte closure);
046
047 public Set<OClass> getSubClasses(Closure closure);
048
049 public ClosableIterator<OClass> getSubClassesIterator(Closure closure);
050
051 /**
052 * Gets the super classes according to the desired closure.
053 *
054 * @param closure either DIRECT_CLOSURE or TRASITIVE_CLOSURE
055 * @return the set of super classes
056 */
057 @Deprecated
058 public Set<OClass> getSuperClasses(byte closure);
059
060 public Set<OClass> getSuperClasses(Closure closure);
061
062 /**
063 * Checks whether the class is a super class of the given class.
064 *
065 * @param aClass
066 * @param closure either OntologyConstants.DIRECT_CLOSURE or
067 * OntologyConstants.TRANSITIVE_CLOSURE
068 * @return true, if the class is a super class of the given class,
069 * otherwise - false.
070 */
071 public boolean isSuperClassOf(OClass aClass, byte closure);
072
073 public boolean isSuperClassOf(OClass aClass, OConstants.Closure closure);
074
075 /**
076 * Checks whether the class is a sub class of the given class.
077 *
078 * @param aClass
079 * @param closure either OntologyConstants.DIRECT_CLOSURE or
080 * OntologyConstants.TRANSITIVE_CLOSURE
081 * @return true, if the class is a sub class of the given class,
082 * otherwise - false.
083 */
084 @Deprecated
085 public boolean isSubClassOf(OClass aClass, byte closure);
086
087 public boolean isSubClassOf(OClass aClass, OConstants.Closure closure);
088
089 /**
090 * Checks whether this class is a top.
091 *
092 * @return true if this is a top class, otherwise - false.
093 */
094 public boolean isTopClass();
095
096 /** Indicates that these classes are the equivalent */
097 public void setEquivalentClassAs(OClass theClass);
098
099 /**
100 * Returns a set of all classes that are equivalent as this one. Null
101 * if no such classes.
102 */
103 public Set<OClass> getEquivalentClasses();
104
105 /**
106 * Checks whether the class is equivalent as the given class.
107 *
108 * @param aClass
109 * @return true, if the class is equivalent as the aClass, otherwise -
110 * false.
111 */
112 public boolean isEquivalentClassAs(OClass aClass);
113
114 /**
115 * Gets the super classes, and returns them in an array list where on
116 * each index there is a collection of the super classes at distance -
117 * the index.
118 */
119 public ArrayList<Set<OClass>> getSuperClassesVSDistance();
120
121 /**
122 * Gets the sub classes, and returns them in an array list where on
123 * each index there is a collection of the sub classes at distance -
124 * the index.
125 */
126 public ArrayList<Set<OClass>> getSubClassesVsDistance();
127
128 }
|