1
2
3
4
5
6 package org.dbe.studio.tools.ontologyviewer.metamodels.odm;
7
8 import java.util.Vector;
9
10 /***
11 * The instance of an OntologyClass. It contains its type (class) as well as
12 * its Datatype Properties (attributes)
13 *
14 */
15 public abstract class OdmOntologyClassInst {
16
17 String name;
18 String id;
19 Vector annotationProps;
20
21 OdmOntology theOntology;
22 OdmOntologyClass type;
23
24 /***
25 * Default constructor
26 */
27 public OdmOntologyClassInst() {
28 super();
29
30 }
31
32 public OdmOntologyClassInst(OdmOntology ont, String name, String id, OdmOntologyClass type) {
33
34
35 theOntology = ont;
36
37 this.type = type;
38
39 this.type.addClassInstance(this);
40
41 this.name = name;
42 this.id = id;
43
44
45 theOntology.addClassInstance(this);
46 }
47
48 public void addAnnotationProp(OdmAnnotationProperty ap) {
49 if ( annotationProps == null ) {
50 annotationProps = new Vector();
51 }
52 annotationProps.add(ap);
53
54 }
55
56 public void removeAnnotationProp(OdmAnnotationProperty ap) {
57 if (annotationProps != null) {
58 annotationProps.remove(ap);
59 }
60 }
61
62 public void setName(String name) {
63 this.name = name;
64 }
65
66 public void setId(String id) {
67 this.id = id;
68 }
69
70 public void setType(OdmOntologyClass type) {
71 this.type = type;
72 }
73
74 public void setOntology(OdmOntology ont) {
75 theOntology = ont;
76 }
77
78 public void setAnnotationProps(Vector a) {
79 annotationProps = a;
80 }
81
82 public String getName() {
83 return name;
84 }
85
86 public String getId() {
87 return id;
88 }
89
90 public OdmOntologyClass getType() {
91 return type;
92 }
93
94 public OdmOntology getOntology() {
95 return theOntology;
96 }
97
98 public Vector getAnnotationProps() {
99 return annotationProps;
100 }
101 }