SPI implementation

This commit is contained in:
leventov
2015-05-27 00:03:20 +01:00
parent 8e4027da08
commit b4c8554b77
111 changed files with 13637 additions and 3991 deletions
@@ -20,17 +20,17 @@ package net.openhft.chronicle.map;
final class MapMethodsSupport {
static <K, V> void returnCurrentValueIfPresent(
MapQueryContext<K, V> q, ReturnValue<? super V> returnValue) {
MapEntry<K, V> entry = q.entry();
static <V> void returnCurrentValueIfPresent(
MapQueryContext<?, V, ?> q, ReturnValue<V> returnValue) {
MapEntry<?, V> entry = q.entry();
if (entry != null)
returnValue.returnValue(entry.value());
}
static <K, V> boolean tryReturnCurrentValueIfPresent(
MapQueryContext<K, V> q, ReturnValue<? super V> returnValue) {
static <V> boolean tryReturnCurrentValueIfPresent(
MapQueryContext<?, V, ?> q, ReturnValue<V> returnValue) {
if (q.readLock().tryLock()) {
MapEntry<K, V> entry = q.entry();
MapEntry<?, V> entry = q.entry();
if (entry != null) {
returnValue.returnValue(entry.value());
return true;
@@ -39,7 +39,7 @@ final class MapMethodsSupport {
q.readLock().unlock();
}
q.updateLock().lock();
MapEntry<K, V> entry = q.entry();
MapEntry<?, V> entry = q.entry();
if (entry != null) {
returnValue.returnValue(entry.value());
return true;