Standard code formatting

This commit is contained in:
Peter Lawrey
2018-04-21 10:49:49 +01:00
parent c7efd950f8
commit 9323cf28a7
270 changed files with 2801 additions and 2551 deletions
@@ -33,6 +33,16 @@ import static net.openhft.chronicle.hash.impl.util.Objects.requireNonNull;
interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
// TODO quick and dirty. Think about how generic guava/koloboke equivalence interface could be
// used. See also BytesInterop.equivalent() and hash().
static int hashCode(Object obj) {
if (!(obj instanceof CharSequence)) {
return obj.hashCode();
} else {
return CharSequences.hash((CharSequence) obj);
}
}
@Override
default <R> R getMapped(K key, @NotNull SerializableFunction<? super V, R> function) {
requireNonNull(function);
@@ -84,7 +94,7 @@ interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
@Override
public Iterator<V> iterator() {
return new Iterator<V>() {
private Iterator<Entry<K,V>> i = entrySet().iterator();
private Iterator<Entry<K, V>> i = entrySet().iterator();
@Override
public boolean hasNext() {
@@ -170,7 +180,7 @@ interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
if (!(o instanceof Map))
return false;
Map<?,?> m = (Map<?,?>) o;
Map<?, ?> m = (Map<?, ?>) o;
if ((m instanceof ChronicleMap ? ((ChronicleMap) m).longSize() : m.size()) != longSize())
return false;
@@ -201,16 +211,6 @@ interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
return h[0];
}
// TODO quick and dirty. Think about how generic guava/koloboke equivalence interface could be
// used. See also BytesInterop.equivalent() and hash().
static int hashCode(Object obj) {
if (!(obj instanceof CharSequence)) {
return obj.hashCode();
} else {
return CharSequences.hash((CharSequence) obj);
}
}
default String mapToString() {
if (isEmpty())
return "{}";