1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package olr.rdf;
20
21
22
23 public class Attribute
24 {
25
26 public Attribute(String predicate, String object)
27 {
28 this.predicate = Tools.correctURI(predicate);
29 this.object = Tools.correctURI(object);
30 ID = hashCode();
31 }
32
33 public Attribute(String predicate, String object, int ID)
34 {
35 this.predicate = Tools.correctURI(predicate);
36 this.object = Tools.correctURI(object);
37 this.ID = ID;
38 }
39
40 public Attribute(Attribute attribute)
41 {
42 predicate = attribute.getPredicate();
43 object = attribute.getObject();
44 ID = attribute.getID();
45 }
46
47 public String getPredicate()
48 {
49 return predicate;
50 }
51
52 public String getObject()
53 {
54 return object;
55 }
56
57 public void setObject(String object)
58 {
59 this.object = Tools.correctURI(object);
60 }
61
62 public boolean hasObject()
63 {
64 return object.length() > 0;
65 }
66
67 public int getID()
68 {
69 return ID;
70 }
71
72 public String toString()
73 {
74 return String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(predicate.toString())))).append('=').append(object.toString())));
75 }
76
77 protected String predicate;
78 protected String object;
79 private int ID;
80 }