svn-gvsig-desktop / trunk / libraries / libGDBMS / src / main / java / com / hardcode / gdbms / engine / values / ComplexValue.java @ 8054
History | View | Annotate | Download (2.12 KB)
1 |
package com.hardcode.gdbms.engine.values; |
---|---|
2 |
|
3 |
import java.sql.Types; |
4 |
import java.util.Collection; |
5 |
import java.util.LinkedHashMap; |
6 |
import java.util.Map; |
7 |
import java.util.Set; |
8 |
|
9 |
public class ComplexValue extends StringValue implements Map { |
10 |
private LinkedHashMap mapValues =null; |
11 |
|
12 |
/**
|
13 |
* Construye un objeto ConplexValue con el texto que se pasa como parametro
|
14 |
*
|
15 |
* @param text
|
16 |
*/
|
17 |
ComplexValue(String text) {
|
18 |
super();
|
19 |
this.mapValues = new LinkedHashMap(); |
20 |
this.setValue(text);
|
21 |
} |
22 |
|
23 |
/**
|
24 |
* Creates a new ComplexValue object.
|
25 |
*/
|
26 |
ComplexValue() { |
27 |
super();
|
28 |
this.mapValues = new LinkedHashMap(); |
29 |
} |
30 |
|
31 |
private void parse() { |
32 |
//TODO: implementar
|
33 |
} |
34 |
|
35 |
private String dump() { |
36 |
//TODO: implementar
|
37 |
return null; |
38 |
} |
39 |
|
40 |
public int size() { |
41 |
return this.mapValues.size(); |
42 |
} |
43 |
|
44 |
public void clear() { |
45 |
super.setValue(""); |
46 |
this.mapValues.clear();
|
47 |
|
48 |
} |
49 |
|
50 |
public boolean isEmpty() { |
51 |
return this.mapValues.isEmpty(); |
52 |
} |
53 |
|
54 |
public boolean containsKey(Object key) { |
55 |
return this.mapValues.containsKey(key); |
56 |
} |
57 |
|
58 |
public boolean containsValue(Object value) { |
59 |
return this.mapValues.containsValue(value); |
60 |
} |
61 |
|
62 |
public Collection values() { |
63 |
return this.mapValues.values(); |
64 |
} |
65 |
|
66 |
public void putAll(Map t) { |
67 |
throw new UnsupportedOperationException(); |
68 |
} |
69 |
|
70 |
public Set entrySet() { |
71 |
return this.mapValues.entrySet(); |
72 |
} |
73 |
|
74 |
public Set keySet() { |
75 |
return this.mapValues.keySet(); |
76 |
} |
77 |
|
78 |
public Object get(Object key) { |
79 |
return this.mapValues.get(key); |
80 |
} |
81 |
|
82 |
public Object remove(Object key) { |
83 |
return this.mapValues.remove(key); |
84 |
} |
85 |
|
86 |
public Object put(Object key, Object value) { |
87 |
// FIXME: Falta comprobar que value sea instancia de Value
|
88 |
return this.mapValues.put(key,value); |
89 |
} |
90 |
|
91 |
public String getStringValue(ValueWriter writer) { |
92 |
super.setValue(this.dump()); |
93 |
return super.getStringValue(writer); |
94 |
} |
95 |
|
96 |
public String getValue() { |
97 |
super.setValue(this.dump()); |
98 |
return super.getValue(); |
99 |
} |
100 |
|
101 |
public void setValue(String value) { |
102 |
super.setValue(value);
|
103 |
this.parse();
|
104 |
} |
105 |
|
106 |
public String toString() { |
107 |
return this.getValue(); |
108 |
} |
109 |
|
110 |
public int getSQLType() { |
111 |
//return super.getSQLType(); --> Types.LONGVARCHAR;
|
112 |
return Types.STRUCT; |
113 |
} |
114 |
|
115 |
} |