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

ucar.nc2.util.cache.HashQueue Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 1998-2018 John Caron and University Corporation for Atmospheric Research/Unidata
 * See LICENSE for license information.
 */

package ucar.nc2.util.cache;

import java.util.Comparator;
import java.util.Iterator;
import java.util.NavigableMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentSkipListMap;

/**
 * Describe
 *
 * @author caron
 * @since 10/29/2014
 */
public class HashQueue {

  private NavigableMap cache;

  public HashQueue(Comparator comparator) {

    cache = new ConcurrentSkipListMap<>(comparator);
  }


  public V get(K key) {
    return cache.get(key);
  }

  public V remove(K key) {
    return cache.remove(key);
  }

  public void makeMRU(K key) {
    // Iterator iter = cache.iterator();

  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy