mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-119 removed the use of " public <K, V> SharedHashMap<K, V> create(File file, Class<K> kClass, Class<V> vClass) "
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2014 Higher Frequency Trading
|
||||
* <p/>
|
||||
* http://www.higherfrequencytrading.com
|
||||
* <p/>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.openhft.collections;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
public interface CollectionView<K, V, E> {
|
||||
|
||||
AbstractVanillaSharedMap<K, V> getMap();
|
||||
|
||||
/**
|
||||
* Removes all of the elements from this view, by removing all the mappings from the map backing this
|
||||
* view.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
int size();
|
||||
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
// implementations below rely on concrete classes supplying these
|
||||
// abstract methods
|
||||
|
||||
/**
|
||||
* Returns an iterator over the elements in this collection.
|
||||
*
|
||||
* <p>The returned iterator is <a href="package-summary.html#Weakly"><i>weakly consistent</i></a>.
|
||||
*
|
||||
* @return an iterator over the elements in this collection
|
||||
*/
|
||||
Iterator<E> iterator();
|
||||
|
||||
boolean contains(Object o);
|
||||
|
||||
boolean remove(Object o);
|
||||
|
||||
static final String oomeMsg = "Required array size too large";
|
||||
|
||||
Object[] toArray();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
<T> T[] toArray(T[] a);
|
||||
|
||||
/**
|
||||
* Returns a string representation of this collection. The string representation consists of the string
|
||||
* representations of the collection's elements in the order they are returned by its iterator, enclosed
|
||||
* in square brackets ({@code "[]"}). Adjacent elements are separated by the characters {@code ", "}
|
||||
* (comma and space). Elements are converted to strings as by {@link String#valueOf(Object)}.
|
||||
*
|
||||
* @return a string representation of this collection
|
||||
*/
|
||||
String toString();
|
||||
|
||||
boolean containsAll(Collection<?> c);
|
||||
|
||||
boolean removeAll(Collection<?> c);
|
||||
|
||||
boolean retainAll(Collection<?> c);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public interface ConcurrentMapLamdadSupport<K, V> {
|
||||
*
|
||||
* @return the set view
|
||||
*/
|
||||
AbstractVanillaSharedMap.KeySetView<K, V> keySet();
|
||||
net.openhft.collections.KeySetView<K, V> keySet();
|
||||
|
||||
|
||||
long mappingCount();
|
||||
|
||||
@@ -27,7 +27,8 @@ import java.util.function.Consumer;
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
public interface KeySetView<K, V> extends Collection<K>, java.io.Serializable, Set<K> {
|
||||
public interface KeySetView<K, V> extends Collection<K>, java.io.Serializable, Set<K>, CollectionView<K, V,
|
||||
K> {
|
||||
/**
|
||||
* Returns the default mapped value for additions, or {@code null} if additions are not supported.
|
||||
*
|
||||
|
||||
@@ -84,7 +84,7 @@ abstract class AbstractVanillaSharedMap<K, V> extends net.openhft.collections.Co
|
||||
* Base class for views.
|
||||
*/
|
||||
abstract static class CollectionView<K, V, E>
|
||||
implements Collection<E>, java.io.Serializable {
|
||||
implements Collection<E>, net.openhft.collections.CollectionView<K, V, E>, java.io.Serializable {
|
||||
private static final long serialVersionUID = 7249069246763182397L;
|
||||
final AbstractVanillaSharedMap<K, V> map;
|
||||
|
||||
@@ -452,6 +452,7 @@ abstract class AbstractVanillaSharedMap<K, V> extends net.openhft.collections.Co
|
||||
return new KeySetView<K, V>(this, mappedValue);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A view of a ConcurrentHashMap as a {@link Set} of keys, in which additions may optionally be enabled by
|
||||
* mapping to a common value. This class cannot be directly instantiated. See {@link #keySet() keySet()},
|
||||
@@ -462,6 +463,7 @@ abstract class AbstractVanillaSharedMap<K, V> extends net.openhft.collections.Co
|
||||
*/
|
||||
public static class KeySetView<K, V> extends CollectionView<K, V, K>
|
||||
implements Set<K>, java.io.Serializable, net.openhft.collections.KeySetView<K, V> {
|
||||
|
||||
private static final long serialVersionUID = 7249069246763182397L;
|
||||
private final V value;
|
||||
|
||||
@@ -1639,7 +1641,11 @@ abstract class AbstractVanillaSharedMap<K, V> extends net.openhft.collections.Co
|
||||
return putVal(key, value, false);
|
||||
}
|
||||
|
||||
V putVal(K key, V value, boolean replaceIfPresent) {
|
||||
V putVal(K key, V value, boolean onlyIfAbsent) {
|
||||
return put0(key, value, !onlyIfAbsent);
|
||||
}
|
||||
|
||||
V put0(K key, V value, boolean replaceIfPresent) {
|
||||
super.putVal(key, value, replaceIfPresent);
|
||||
checkKey(key);
|
||||
checkValue(value);
|
||||
@@ -2731,7 +2737,6 @@ abstract class AbstractVanillaSharedMap<K, V> extends net.openhft.collections.Co
|
||||
}
|
||||
|
||||
|
||||
|
||||
Entry<K, V> nextSegmentEntry() {
|
||||
while (segmentIndex >= 0) {
|
||||
if (segmentPositions.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user