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

com.ebay.jetstream.util.offheap.OffHeapLinkedHashMap Maven / Gradle / Ivy

/*******************************************************************************
 *  Copyright © 2012-2015 eBay Software Foundation
 *  This program is dual licensed under the MIT and Apache 2.0 licenses.
 *  Please see LICENSE for more information.
 *******************************************************************************/
package com.ebay.jetstream.util.offheap;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
/**
 * An off heap linked hash map without unnecessary overhead on Map interface.
 * 
 * @author xingwang
 *
 * @param 
 * @param 
 */
public interface OffHeapLinkedHashMap {
    /**
     * Remove the first entry.
     * 
     * @return
     */
    Entry removeFirst();
    
    /**
     * Add an iterator for access keys by insertion order. 
     * 
     * @return
     */
    Iterator keyIterator();
    
    /**
     * Add an iterator for access entries by insertion order. 
     * 
     * @return
     */
    Iterator> entryIterator();

    /**
     * Remove entry by key.
     * 
     * @param k
     * @return
     */
    boolean remove(K k);

    /**
     * Put an new entry and it will be put on the tail of the map.
     * 
     * @param k
     * @param v
     * @return
     */
    boolean put(K k, V v);

    /**
     * Return size.
     * 
     * @return
     */
    int size();

    /**
     * Return first entry.
     * 
     * @return
     */
    Entry getFirst();

    /**
     * Return value by key.
     * 
     * @param k
     * @return
     */
    V get(K k);

    /**
     * Clear the map.
     */
    void clear();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy