01: package org.jical;
02:
03: import java.util.Collections;
04: import java.util.HashMap;
05: import java.util.Iterator;
06: import java.util.Map;
07:
08: public class MutableContentLine implements ContentLine {
09: private String m_name;
10: private String m_value;
11: private Map m_parameters = new HashMap();
12: private Map m_unmodifiableParameters = Collections
13: .unmodifiableMap(m_parameters);
14:
15: public String getName() {
16: return m_name;
17: }
18:
19: public void setName(String name) {
20: m_name = name;
21: }
22:
23: public String getValue() {
24: return m_value;
25: }
26:
27: public void setValue(String value) {
28: m_value = value;
29: }
30:
31: public Map getParameters() {
32: return m_unmodifiableParameters;
33: }
34:
35: public Map getMutableParameters() {
36: return m_parameters;
37: }
38:
39: public String toString() {
40: String s = getName();
41: Iterator it = getParameters().entrySet().iterator();
42: while (it.hasNext()) {
43: Map.Entry e = (Map.Entry) it.next();
44: s += ";" + e.getKey() + "=\"" + e.getValue() + "\"";
45: }
46: s += ":" + getValue();
47: return s;
48: }
49:
50: private String m_rawline;
51:
52: public String getRawLine() {
53: return m_rawline;
54: }
55:
56: public void setRawLine(String rawline) {
57: m_rawline = rawline;
58: }
59: }
|