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

javolution.util.internal.map.SequentialMapImpl Maven / Gradle / Ivy

/*
 * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
 * Copyright (C) 2012 - Javolution (http://javolution.org/)
 * All rights reserved.
 * 
 * Permission to use, copy, modify, and distribute this software is
 * freely granted, provided that this notice is preserved.
 */
package javolution.util.internal.map;

import java.util.Iterator;

import javolution.util.function.Consumer;
import javolution.util.function.Equality;
import javolution.util.service.MapService;

/**
 * A sequential view over a map.
 */
public class SequentialMapImpl extends MapView {

    private static final long serialVersionUID = 0x600L; // Version.

    public SequentialMapImpl(MapService target) {
        super(target);
    }

    @Override
    public void clear() {
        target().clear();
    }

    @Override
    public boolean containsKey(Object key) {
        return target().containsKey(key);
    }

    @Override
    public V get(Object key) {
        return target().get(key);
    }

    @Override
    public boolean isEmpty() {
        return target().isEmpty();
    }

    @Override
    public Iterator> iterator() {
        return target().iterator();
    }

    @Override
    public Equality keyComparator() {
        return target().keyComparator();
    }

    @Override
    public void perform(Consumer> action, MapService view) {
        action.accept(view); // Executes immediately.
    }

    @Override
    public V put(K key, V value) {
        return target().put(key, value);
    }

    @Override
    public V remove(Object key) {
        return target().remove(key);
    }

    @Override
    public int size() {
        return target().size();
    }

    @Override
    public void update(Consumer> action, MapService view) {
        action.accept(view); // Executes immediately.
    }

    @Override
    public Equality valueComparator() {
        return target().valueComparator();
    }

    @Override
    public MapService[] split(int n, boolean threadsafe) {
        return target().split(n, threadsafe); // Forwards.
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy