001: /*
002: JSPWiki - a JSP-based WikiWiki clone.
003:
004: Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
005:
006: This program is free software; you can redistribute it and/or modify
007: it under the terms of the GNU Lesser General Public License as published by
008: the Free Software Foundation; either version 2.1 of the License, or
009: (at your option) any later version.
010:
011: This program is distributed in the hope that it will be useful,
012: but WITHOUT ANY WARRANTY; without even the implied warranty of
013: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: GNU Lesser General Public License for more details.
015:
016: You should have received a copy of the GNU Lesser General Public License
017: along with this program; if not, write to the Free Software
018: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: */
020: package com.ecyrd.jspwiki.htmltowiki;
021:
022: import java.util.Collection;
023: import java.util.Map;
024: import java.util.Properties;
025: import java.util.Set;
026:
027: /**
028: * Adds the load / save - functionality known from the Properties - class to any
029: * Map implementation.
030: *
031: * @author Sebastian Baltes (sbaltes@gmx.com)
032: */
033: public class PersistentMapDecorator extends Properties {
034: private static final long serialVersionUID = 0L;
035:
036: private Map m_delegate;
037:
038: public PersistentMapDecorator(Map delegate) {
039: this .m_delegate = delegate;
040: }
041:
042: public void clear() {
043: m_delegate.clear();
044: }
045:
046: public boolean containsKey(Object key) {
047: return m_delegate.containsKey(key);
048: }
049:
050: public boolean containsValue(Object value) {
051: return m_delegate.containsValue(value);
052: }
053:
054: public Set entrySet() {
055: return m_delegate.entrySet();
056: }
057:
058: public boolean equals(Object obj) {
059: return m_delegate.equals(obj);
060: }
061:
062: public Object get(Object key) {
063: return m_delegate.get(key);
064: }
065:
066: public int hashCode() {
067: return m_delegate.hashCode();
068: }
069:
070: public boolean isEmpty() {
071: return m_delegate.isEmpty();
072: }
073:
074: public Set keySet() {
075: return m_delegate.keySet();
076: }
077:
078: public Object put(Object arg0, Object arg1) {
079: return m_delegate.put(arg0, arg1);
080: }
081:
082: public void putAll(Map arg0) {
083: m_delegate.putAll(arg0);
084: }
085:
086: public Object remove(Object key) {
087: return m_delegate.remove(key);
088: }
089:
090: public int size() {
091: return m_delegate.size();
092: }
093:
094: public String toString() {
095: return m_delegate.toString();
096: }
097:
098: public Collection values() {
099: return m_delegate.values();
100: }
101: }
|