move remaining CHM construction to the factory method

This commit is contained in:
Shay Banon 2012-06-12 17:26:36 +02:00
parent 95fc7a39a3
commit ab35e7ce7a
2 changed files with 4 additions and 16 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.common.util.concurrent;
import jsr166e.ConcurrentHashMapV8;
import org.elasticsearch.common.collect.MapBackedSet;
import java.util.Set;

View File

@ -20,20 +20,19 @@
package org.elasticsearch.common.util.concurrent;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
*
*/
public class ConcurrentHashMapLong<T> implements ConcurrentMapLong<T> {
private final ConcurrentHashMap<Long, T> map;
private final ConcurrentMap<Long, T> map;
public ConcurrentHashMapLong() {
this.map = new ConcurrentHashMap<Long, T>();
this.map = ConcurrentCollections.newConcurrentMap();
}
@Override
@ -83,10 +82,6 @@ public class ConcurrentHashMapLong<T> implements ConcurrentMapLong<T> {
return map.containsValue(value);
}
public boolean contains(Object value) {
return map.contains(value);
}
public T put(Long key, T value) {
return map.put(key, value);
}
@ -137,14 +132,6 @@ public class ConcurrentHashMapLong<T> implements ConcurrentMapLong<T> {
return map.entrySet();
}
public Enumeration<Long> keys() {
return map.keys();
}
public Enumeration<T> elements() {
return map.elements();
}
@Override
public boolean equals(Object o) {
return map.equals(o);