MutableContentLine.java :  » Groupware » hipergate » org » jical » Java Open Source

Java Open Source » Groupware » hipergate 
hipergate » org » jical » MutableContentLine.java
package org.jical;

import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class MutableContentLine implements ContentLine {
    private String m_name;
    private String m_value;
    private Map m_parameters = new HashMap();
    private Map m_unmodifiableParameters = Collections.unmodifiableMap( m_parameters );

    public String getName() {
  return m_name;
    }
    public void setName( String name ) {
  m_name = name;
    }
    public String getValue() {
  return m_value;
    }
    public void setValue( String value ) {
  m_value = value;
    }
    public Map getParameters() {
  return m_unmodifiableParameters;
    }
    public Map getMutableParameters() {
  return m_parameters;
    }

    public String toString() {
  String s = getName();
  Iterator it = getParameters().entrySet().iterator();
  while ( it.hasNext() ) {
      Map.Entry e = (Map.Entry) it.next();
      s += ";" + e.getKey() + "=\"" + e.getValue() +"\"";
  }
  s+= ":"+getValue();
  return s;
    }

    private String m_rawline;
    public String getRawLine() {
  return m_rawline;
    }
    public void setRawLine( String rawline ) {
  m_rawline = rawline;
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.