Mercurial > hg > Members > nobuyasu > Consensus
view 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 |
line wrap: on
line source
package models; import java.util.HashMap; import com.tinkerpop.blueprints.Vertex; public class NodeModel { protected Vertex vertex; protected Object id; protected HashMap<Object,Object> properties = new HashMap<Object,Object>(); public static final String ID = "id"; public static final String AUTHOR = "author"; public static final String TYPE = "type"; public static final String MENTIONS = "mentions"; public static final String QUESTION = "question"; public static final String REFUTATION = "refutation"; public static final String MAJORITY = "majority"; public static final String UNANIMOUSLY = "unanimously"; /* * User property */ public static final String CONSENSUS = "consensus"; public static final String CLAIMS = "claims"; public static final String REQUESTS = "requests"; /* * Claim property */ public static final String TOULMIN = "toulmin"; public static final String TITLE = "title"; public static final String CONTENTS = "contents"; public static final String QUALIFIER = "q"; public static final String DATA = "d"; public static final String WARRANT = "w"; public static final String BACKING = "b"; public static final String REBUTTLE = "r"; public static final String USERS = "users"; public static final String STATUS = "status"; // Status statement public static final String PASS = "pass"; public static final String FAIL = "fail"; public static final String AGREED = "agreed"; public static final String DENIED = "denied"; public NodeModel(Vertex vertex) { this.vertex = vertex; this.id = vertex.getId(); } public void setId(Object id) { this.id = id; } public Object getId() { return this.id; } public Vertex getVertex() { return this.vertex; } public void setProperty(String key, Object value) { this.vertex.setProperty(key, value); } public HashMap<Object,Object> getAllProperty() { for (String key : vertex.getPropertyKeys()) { properties.put(key, vertex.getProperty(key)); } return properties; } }