All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gargoylesoftware.htmlunit.util.MapWrapper Maven / Gradle / Ivy

Go to download

Vaadin is a web application framework for Rich Internet Applications (RIA). Vaadin enables easy development and maintenance of fast and secure rich web applications with a stunning look and feel and a wide browser support. It features a server-side architecture with the majority of the logic running on the server. Ajax technology is used at the browser-side to ensure a rich and interactive user experience.

There is a newer version: 1.2.0
Show newest version
/*
 * Copyright (c) 2002-2011 Gargoyle Software Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.gargoylesoftware.htmlunit.util;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 * Map implementation delegating all calls to the wrapped Map instance. This
 * class is Serializable, but serialization will fail if the wrapped map is not
 * itself Serializable.
 *
 * @version $Revision: 6204 $
 * @author Marc Guillemot
 * @param  the type of the map key
 * @param  the type of the value
 */
public class MapWrapper implements Map, Serializable {

    private Map wrappedMap_;

    /**
     * Simple constructor. Needed to allow subclasses to be serializable.
     */
    protected MapWrapper() {
        // Empty.
    }

    /**
     * Initializes the wrapper with its wrapped map.
     * @param map the map to wrap.
     */
    public MapWrapper(final Map map) {
        wrappedMap_ = map;
    }

    /**
     * {@inheritDoc}
     */
    public void clear() {
        wrappedMap_.clear();
    }

    /**
     * {@inheritDoc}
     */
    public boolean containsKey(final Object key) {
        return wrappedMap_.containsKey(key);
    }

    /**
     * {@inheritDoc}
     */
    public boolean containsValue(final Object value) {
        return wrappedMap_.containsValue(value);
    }

    /**
     * {@inheritDoc}
     */
    public Set> entrySet() {
        return wrappedMap_.entrySet();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(final Object o) {
        return wrappedMap_.equals(o);
    }

    /**
     * {@inheritDoc}
     */
    public V get(final Object key) {
        return wrappedMap_.get(key);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        return wrappedMap_.hashCode();
    }

    /**
     * {@inheritDoc}
     */
    public boolean isEmpty() {
        return wrappedMap_.isEmpty();
    }

    /**
     * {@inheritDoc}
     */
    public Set keySet() {
        return wrappedMap_.keySet();
    }

    /**
     * {@inheritDoc}
     */
    public V put(final K key, final V value) {
        return wrappedMap_.put(key, value);
    }

    /**
     * {@inheritDoc}
     */
    public void putAll(final Map< ? extends K, ? extends V> t) {
        wrappedMap_.putAll(t);
    }

    /**
     * {@inheritDoc}
     */
    public V remove(final Object key) {
        return wrappedMap_.remove(key);
    }

    /**
     * {@inheritDoc}
     */
    public int size() {
        return wrappedMap_.size();
    }

    /**
     * {@inheritDoc}
     */
    public Collection values() {
        return wrappedMap_.values();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy