1 package org.jical; 2 3 import java.util.Collections ; 4 import java.util.HashMap ; 5 import java.util.Iterator ; 6 import java.util.Map ; 7 8 public class MutableContentLine implements ContentLine { 9 private String m_name; 10 private String m_value; 11 private Map m_parameters = new HashMap (); 12 private Map m_unmodifiableParameters = Collections.unmodifiableMap( m_parameters ); 13 14 public String getName() { 15 return m_name; 16 } 17 public void setName( String name ) { 18 m_name = name; 19 } 20 public String getValue() { 21 return m_value; 22 } 23 public void setValue( String value ) { 24 m_value = value; 25 } 26 public Map getParameters() { 27 return m_unmodifiableParameters; 28 } 29 public Map getMutableParameters() { 30 return m_parameters; 31 } 32 33 public String toString() { 34 String s = getName(); 35 Iterator it = getParameters().entrySet().iterator(); 36 while ( it.hasNext() ) { 37 Map.Entry e = (Map.Entry ) it.next(); 38 s += ";" + e.getKey() + "=\"" + e.getValue() +"\""; 39 } 40 s+= ":"+getValue(); 41 return s; 42 } 43 44 private String m_rawline; 45 public String getRawLine() { 46 return m_rawline; 47 } 48 public void setRawLine( String rawline ) { 49 m_rawline = rawline; 50 } 51 } 52 | Popular Tags |