svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libDwg / src / org / gvsig / dwg / lib / objects / DwgDictionary.java @ 28969
History | View | Annotate | Download (2.07 KB)
1 |
package org.gvsig.dwg.lib.objects; |
---|---|
2 |
|
3 |
import java.io.Serializable; |
4 |
import java.util.ArrayList; |
5 |
import java.util.Collection; |
6 |
import java.util.HashMap; |
7 |
import java.util.Map; |
8 |
import java.util.Set; |
9 |
|
10 |
import org.gvsig.dwg.lib.DwgHandleReference; |
11 |
import org.gvsig.dwg.lib.DwgObject; |
12 |
import org.gvsig.dwg.lib.DwgUtil; |
13 |
|
14 |
|
15 |
public class DwgDictionary extends DwgObject implements Cloneable, Map, Serializable{ |
16 |
|
17 |
/**
|
18 |
*
|
19 |
*/
|
20 |
private static final long serialVersionUID = -5594420471375074362L; |
21 |
private HashMap map; |
22 |
private int hardOwnerFlag; |
23 |
private int cloningFlag; |
24 |
private DwgHandleReference parentHandle;
|
25 |
|
26 |
public DwgDictionary(int index) { |
27 |
super(index);
|
28 |
map = new HashMap(); |
29 |
} |
30 |
|
31 |
public int size() { |
32 |
return map.size();
|
33 |
} |
34 |
|
35 |
public void clear() { |
36 |
map.clear(); |
37 |
} |
38 |
|
39 |
public boolean isEmpty() { |
40 |
return map.isEmpty();
|
41 |
} |
42 |
|
43 |
public boolean containsKey(Object key) { |
44 |
return map.containsKey(key);
|
45 |
} |
46 |
|
47 |
public boolean containsValue(Object value) { |
48 |
return map.containsKey(value);
|
49 |
} |
50 |
|
51 |
public Collection values() { |
52 |
return map.values();
|
53 |
} |
54 |
|
55 |
public void putAll(Map t) { |
56 |
map.putAll(t); |
57 |
|
58 |
} |
59 |
|
60 |
public Set entrySet() { |
61 |
return map.entrySet();
|
62 |
} |
63 |
|
64 |
public Set keySet() { |
65 |
return map.keySet();
|
66 |
} |
67 |
|
68 |
public Object get(Object key) { |
69 |
return map.get(key);
|
70 |
} |
71 |
|
72 |
public Object remove(Object key) { |
73 |
return map.remove(key);
|
74 |
} |
75 |
|
76 |
public Object put(Object key, Object value) { |
77 |
return map.put(key, value);
|
78 |
} |
79 |
|
80 |
|
81 |
public void setCloningFlag(int cloningFlag) { |
82 |
this.cloningFlag = cloningFlag;
|
83 |
|
84 |
} |
85 |
|
86 |
private int getCloningFlag() { |
87 |
return this.cloningFlag; |
88 |
|
89 |
} |
90 |
|
91 |
public void setHardOwnerFlag(int flag){ |
92 |
this.hardOwnerFlag = flag;
|
93 |
} |
94 |
|
95 |
public int getHardOwnerFlag(){ |
96 |
return this.hardOwnerFlag; |
97 |
} |
98 |
|
99 |
public void setParentHandle(DwgHandleReference handle) { |
100 |
this.parentHandle = handle;
|
101 |
} |
102 |
public Object clone(){ |
103 |
DwgDictionary obj = new DwgDictionary(index);
|
104 |
this.fill(obj);
|
105 |
return obj;
|
106 |
} |
107 |
|
108 |
protected void fill(DwgObject obj){ |
109 |
super.fill(obj);
|
110 |
DwgDictionary myObj = (DwgDictionary)obj; |
111 |
|
112 |
myObj.setCloningFlag(cloningFlag); |
113 |
myObj.setHardOwnerFlag(hardOwnerFlag); |
114 |
myObj.setParentHandle(parentHandle); |
115 |
} |
116 |
|
117 |
} |