annotate app/models/NodeModel.java @ 13:9b677755cb93

create action Claim/createClaim
author one
date Tue, 02 Oct 2012 11:39:39 +0900
parents ef434ebd64ae
children c8ad59a52c7e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
1 package models;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
2
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
3 import java.util.HashMap;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
4
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
5 import com.tinkerpop.blueprints.Vertex;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
6
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
7 public class NodeModel {
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
8
7
2122c50278bd add Global.java, ande models/*
one
parents: 4
diff changeset
9 protected Vertex vertex;
2122c50278bd add Global.java, ande models/*
one
parents: 4
diff changeset
10 protected Object id;
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
11
13
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
12 protected HashMap<Object,Object> properties = new HashMap<Object,Object>();
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
13
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
14 public static final String ID = "id";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
15
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
16
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
17 public static final String AUTHOR = "author";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
18 public static final String TYPE = "type";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
19 public static final String MENTIONS = "mentions";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
20
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
21
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
22 public static final String QUESTION = "question";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
23 public static final String REFUTATION = "refutation";
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
24
13
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
25 public static final String MAJORITY = "majority";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
26 public static final String UNANIMOUSLY = "unanimously";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
27
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
28 /*
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
29 * User property
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
30 */
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
31 public static final String CONSENSUS = "consensus";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
32 public static final String CLAIMS = "claims";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
33 public static final String REQUESTS = "requests";
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
34
13
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
35 /*
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
36 * Claim property
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
37 */
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
38 public static final String TOULMIN = "toulmin";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
39 public static final String TITLE = "title";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
40 public static final String CONTENTS = "contents";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
41 public static final String QUALIFIER = "q";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
42 public static final String DATA = "d";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
43 public static final String WARRANT = "w";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
44 public static final String BACKING = "b";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
45 public static final String REBUTTLE = "r";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
46 public static final String USERS = "users";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
47 public static final String STATUS = "status";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
48 // Status statement
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
49 public static final String PASS = "pass";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
50 public static final String FAIL = "fail";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
51 public static final String AGREED = "agreed";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
52 public static final String DENIED = "denied";
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
53
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
54
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
55 public NodeModel(Vertex vertex) {
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
56 this.vertex = vertex;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
57 this.id = vertex.getId();
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
58 }
7
2122c50278bd add Global.java, ande models/*
one
parents: 4
diff changeset
59
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
60 public void setId(Object id) {
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
61 this.id = id;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
62 }
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
63
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
64 public Object getId() {
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
65 return this.id;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
66 }
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
67
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
68 public Vertex getVertex() {
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
69 return this.vertex;
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
70 }
13
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
71
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
72 public void setProperty(String key, Object value) {
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
73 this.vertex.setProperty(key, value);
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
74 }
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
75
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
76 public HashMap<Object,Object> getAllProperty() {
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
77 for (String key : vertex.getPropertyKeys()) {
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
78 properties.put(key, vertex.getProperty(key));
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
79 }
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
80 return properties;
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
81 }
9b677755cb93 create action Claim/createClaim
one
parents: 12
diff changeset
82
7
2122c50278bd add Global.java, ande models/*
one
parents: 4
diff changeset
83
12
ef434ebd64ae fix NodeModel.java
one
parents: 8
diff changeset
84
3
d0ee9edfff28 add libs, models/NodeModel.java
one
parents:
diff changeset
85 }