1
18
19 package gate.creole.ontology;
20
21 import java.util.HashSet;
22 import java.util.Set;
23
24 public class ObjectPropertyImpl extends PropertyImpl implements ObjectProperty {
25
26 private OClass range;
27 private Set inversePropertiesSet;
28
29 public ObjectPropertyImpl(String aName, OClass aDomain, OClass aRange,
30 Ontology aKB) {
31 super(aName, aDomain, aKB);
32 range = aRange;
33 inversePropertiesSet = new HashSet();
34 }
35
36 public boolean isValueCompatible(Object value) {
37 if (value instanceof OClass)
38 return true;
39 return false;
40 }
41
42 public Object getRange() {
43 return range;
44 }
45
46 public Set getInverseProperties() {
47 return this.inversePropertiesSet;
48 }
49
50 public void setInverseOf(Property theInverse) {
51 this.inversePropertiesSet.add(theInverse);
52 }
53
54 public String toString() {
55 return this.getName() + "(" + this.getDomain() + "," + this.range + ")" +
56 "\n sub-propertyOf "
57 + this.getSubPropertyOf().toString() +
58 "\n samePropertyAs " +
59 this.getSamePropertyAs().toString();
60 }
61
62 }