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

com.distkv.dst.core.DstConcurrentHashMapImpl Maven / Gradle / Ivy

There is a newer version: 0.1.2
Show newest version
package com.distkv.dst.core;

import java.util.concurrent.ConcurrentHashMap;

public class DstConcurrentHashMapImpl implements DstMapInterface {

  private ConcurrentHashMap concurrentHashMap;

  public DstConcurrentHashMapImpl() {
    this.concurrentHashMap = new ConcurrentHashMap();
  }

  @Override
  public void put(K key, V value) {
    concurrentHashMap.put(key, value);
  }

  @Override
  public boolean remove(K key) {
    try {
      concurrentHashMap.remove(key);
      return true;
    } catch (Exception e) {
      return false;
    }
  }

  @Override
  public V get(K key) {
    return concurrentHashMap.get(key);
  }

  @Override
  public boolean containsKey(K key) {
    return concurrentHashMap.containsKey(key);
  }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy