1 package org.catacomb.druid.xtext.data; 2 3 4 import java.util.HashMap; 5 6 public class XItem { 7 8 XType type; 9 String val; 10 11 HashMap<String, String> fields; 12 13 public XItem(XType xt, String text) { 14 type = xt; 15 val = text; 16 fields = new HashMap<String, String>(); 17 } 18 19 public XType getType() { 20 return type; 21 } 22 23 public String getText() { 24 return val; 25 } 26 27 public String getFieldValue(String sid) { 28 String ret = null; 29 if (fields.containsKey(sid)) { 30 ret = fields.get(sid); 31 } 32 return ret; 33 } 34 35 public void setField(String fid, String fval) { 36 fields.put(fid, fval); 37 } 38 39 }