- 更新日時:
- 2014/12/19 18:01:25 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/LabeledMultiDigraph.java
r205 r221 16 16 List<String> labels; 17 17 HashMap<String,Integer> labelednodes; 18 List<Map<Integer,List<LabeledEdge>>> gadjlist; // node, node-edge list18 List<Map<Integer,List<LabeledEdge>>> gadjlist; // grouped adj list: node, node-edge list 19 19 20 20 public class LabeledEdge{ 21 21 Integer node; 22 String label; 23 Direction direction; 24 Integer ntriples; 22 Object label; 25 23 26 public LabeledEdge(Integer node, String label, Direction direction, Integer ntriples){24 public LabeledEdge(Integer node, Object label){ 27 25 this.node = node; 28 26 this.label = label; 29 this.direction = direction; 30 this.ntriples = ntriples; 27 } 28 29 public Object getLabel(){ 30 return label; 31 31 } 32 32 } … … 36 36 labels = new LinkedList<String>(); 37 37 labelednodes = new HashMap<String, Integer>(); 38 gadjlist = new ArrayList<Map<Integer,List<LabeledEdge>>>(); 38 39 } 39 40 … … 45 46 } 46 47 47 public void addEdge(Integer node1, Integer node2, String elabel, Direction direction, Integer ntriples){48 public void addEdge(Integer node1, Integer node2, Object elabel){ 48 49 if ( labels.size() < node1 || labels.size() < node2 ){ 49 50 System.err.println("Error for Edge Addition: No Node for the Edge"); 50 51 return; 51 52 } 52 LabeledEdge edge = new LabeledEdge(node2, elabel , direction, ntriples);53 LabeledEdge edge = new LabeledEdge(node2, elabel); 53 54 adjlist.get(node1).add(edge); 54 55