Mercurial > hg > Members > kono > PLparser
comparison src/plparser/DictProperty.java @ 1:b149a5aa465a
Parser is written
author | kono@ie.u-ryukyu.ac.jp |
---|---|
date | Sat, 28 Aug 2010 17:39:34 +0900 |
parents | |
children | 1f46c9d09c1e |
comparison
equal
deleted
inserted
replaced
0:b0dee5b76b12 | 1:b149a5aa465a |
---|---|
1 package plparser; | |
2 | |
3 import java.util.HashMap; | |
4 import java.util.LinkedList; | |
5 | |
6 public class DictProperty extends Property { | |
7 HashMap<Property, Property> map; | |
8 | |
9 public DictProperty(LinkedList<Property> list) { | |
10 map = new HashMap<Property, Property>(); | |
11 while(!list.isEmpty()) { | |
12 Property key = list.poll(); | |
13 Property value = list.poll(); | |
14 map.put(key, value); | |
15 } | |
16 } | |
17 | |
18 public String toString() { | |
19 String s = "Dictionary{" ; | |
20 for(Property p:map.keySet()) { | |
21 s += p; | |
22 s += "->"; | |
23 s += map.get(p); | |
24 s += ","; | |
25 } | |
26 s += "}"; | |
27 return s; | |
28 } | |
29 | |
30 } |