Remove redundant keywords
This commit is contained in:
parent
6ae173285b
commit
c788e536a9
|
@ -131,7 +131,7 @@ public class FluentIterable<E> implements Iterable<E> {
|
||||||
* Don't allow instances.
|
* Don't allow instances.
|
||||||
*/
|
*/
|
||||||
FluentIterable() {
|
FluentIterable() {
|
||||||
this.iterable = this;
|
iterable = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class SplitMapUtils {
|
||||||
if (arg0 == this) {
|
if (arg0 == this) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return arg0 instanceof WrappedGet && ((WrappedGet<?, ?>) arg0).get.equals(this.get);
|
return arg0 instanceof WrappedGet && ((WrappedGet<?, ?>) arg0).get.equals(get);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -162,7 +162,7 @@ public class SplitMapUtils {
|
||||||
if (obj == this) {
|
if (obj == this) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return obj instanceof WrappedPut && ((WrappedPut<?, ?>) obj).put.equals(this.put);
|
return obj instanceof WrappedPut && ((WrappedPut<?, ?>) obj).put.equals(put);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -157,7 +157,7 @@ public final class ArrayCountingBloomFilter implements CountingBloomFilter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(final IndexExtractor indexExtractor) {
|
public boolean contains(final IndexExtractor indexExtractor) {
|
||||||
return indexExtractor.processIndices(idx -> this.cells[idx] != 0);
|
return indexExtractor.processIndices(idx -> cells[idx] != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -326,7 +326,7 @@ public class LayerManager<T extends BloomFilter> implements BloomFilterExtractor
|
||||||
* @see LayerManager.Builder#setCleanup(Consumer)
|
* @see LayerManager.Builder#setCleanup(Consumer)
|
||||||
*/
|
*/
|
||||||
void cleanup() {
|
void cleanup() {
|
||||||
this.filterCleanup.accept(filters);
|
filterCleanup.accept(filters);
|
||||||
if (filters.isEmpty()) {
|
if (filters.isEmpty()) {
|
||||||
addFilter();
|
addFilter();
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ public class LayerManager<T extends BloomFilter> implements BloomFilterExtractor
|
||||||
* @see LayerManager.Builder#setCleanup(Consumer)
|
* @see LayerManager.Builder#setCleanup(Consumer)
|
||||||
*/
|
*/
|
||||||
void next() {
|
void next() {
|
||||||
this.filterCleanup.accept(filters);
|
filterCleanup.accept(filters);
|
||||||
addFilter();
|
addFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,14 +138,14 @@ public final class SparseBloomFilter implements BloomFilter {
|
||||||
public boolean merge(final IndexExtractor indexExtractor) {
|
public boolean merge(final IndexExtractor indexExtractor) {
|
||||||
Objects.requireNonNull(indexExtractor, "indexExtractor");
|
Objects.requireNonNull(indexExtractor, "indexExtractor");
|
||||||
indexExtractor.processIndices(this::add);
|
indexExtractor.processIndices(this::add);
|
||||||
if (!this.indices.isEmpty()) {
|
if (!indices.isEmpty()) {
|
||||||
if (this.indices.last() >= shape.getNumberOfBits()) {
|
if (indices.last() >= shape.getNumberOfBits()) {
|
||||||
throw new IllegalArgumentException(String.format("Value in list %s is greater than maximum value (%s)",
|
throw new IllegalArgumentException(String.format("Value in list %s is greater than maximum value (%s)",
|
||||||
this.indices.last(), shape.getNumberOfBits() - 1));
|
indices.last(), shape.getNumberOfBits() - 1));
|
||||||
}
|
}
|
||||||
if (this.indices.first() < 0) {
|
if (indices.first() < 0) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format("Value in list %s is less than 0", this.indices.first()));
|
String.format("Value in list %s is less than 0", indices.first()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -157,7 +157,7 @@ public final class BooleanComparator implements Comparator<Boolean>, Serializabl
|
||||||
public boolean equals(final Object object) {
|
public boolean equals(final Object object) {
|
||||||
return this == object ||
|
return this == object ||
|
||||||
object instanceof BooleanComparator &&
|
object instanceof BooleanComparator &&
|
||||||
this.trueFirst == ((BooleanComparator) object).trueFirst;
|
trueFirst == ((BooleanComparator) object).trueFirst;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -134,12 +134,12 @@ public class NullComparator<E> implements Comparator<E>, Serializable {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (o1 == null) {
|
if (o1 == null) {
|
||||||
return this.nullsAreHigh ? 1 : -1;
|
return nullsAreHigh ? 1 : -1;
|
||||||
}
|
}
|
||||||
if (o2 == null) {
|
if (o2 == null) {
|
||||||
return this.nullsAreHigh ? -1 : 1;
|
return nullsAreHigh ? -1 : 1;
|
||||||
}
|
}
|
||||||
return this.nonNullComparator.compare(o1, o2);
|
return nonNullComparator.compare(o1, o2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,8 +167,8 @@ public class NullComparator<E> implements Comparator<E>, Serializable {
|
||||||
|
|
||||||
final NullComparator<?> other = (NullComparator<?>) obj;
|
final NullComparator<?> other = (NullComparator<?>) obj;
|
||||||
|
|
||||||
return this.nullsAreHigh == other.nullsAreHigh &&
|
return nullsAreHigh == other.nullsAreHigh &&
|
||||||
this.nonNullComparator.equals(other.nonNullComparator);
|
nonNullComparator.equals(other.nonNullComparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -81,9 +81,9 @@ public class TransformingComparator<I, O> implements Comparator<I>, Serializable
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int compare(final I obj1, final I obj2) {
|
public int compare(final I obj1, final I obj2) {
|
||||||
final O value1 = this.transformer.apply(obj1);
|
final O value1 = transformer.apply(obj1);
|
||||||
final O value2 = this.transformer.apply(obj2);
|
final O value2 = transformer.apply(obj2);
|
||||||
return this.decorated.compare(value1, value2);
|
return decorated.compare(value1, value2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class ArrayIterator<E> implements ResettableIterator<E> {
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public int getEndIndex() {
|
public int getEndIndex() {
|
||||||
return this.endIndex;
|
return endIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,7 +147,7 @@ public class ArrayIterator<E> implements ResettableIterator<E> {
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public int getStartIndex() {
|
public int getStartIndex() {
|
||||||
return this.startIndex;
|
return startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterator interface
|
// Iterator interface
|
||||||
|
@ -192,7 +192,7 @@ public class ArrayIterator<E> implements ResettableIterator<E> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
this.index = this.startIndex;
|
index = startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPrevious() {
|
public boolean hasPrevious() {
|
||||||
return this.index > this.startIndex;
|
return index > startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,8 +128,8 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
if (!hasNext()) {
|
if (!hasNext()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
this.lastItemIndex = this.index;
|
lastItemIndex = index;
|
||||||
return (E) Array.get(this.array, this.index++);
|
return (E) Array.get(array, index++);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,7 +139,7 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int nextIndex() {
|
public int nextIndex() {
|
||||||
return this.index - this.startIndex;
|
return index - startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,8 +154,8 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
if (!hasPrevious()) {
|
if (!hasPrevious()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
this.lastItemIndex = --this.index;
|
lastItemIndex = --index;
|
||||||
return (E) Array.get(this.array, this.index);
|
return (E) Array.get(array, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,7 +165,7 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int previousIndex() {
|
public int previousIndex() {
|
||||||
return this.index - this.startIndex - 1;
|
return index - startIndex - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,7 +174,7 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
super.reset();
|
super.reset();
|
||||||
this.lastItemIndex = -1;
|
lastItemIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -197,11 +197,11 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void set(final Object o) {
|
public void set(final Object o) {
|
||||||
if (this.lastItemIndex == -1) {
|
if (lastItemIndex == -1) {
|
||||||
throw new IllegalStateException("must call next() or previous() before a call to set()");
|
throw new IllegalStateException("must call next() or previous() before a call to set()");
|
||||||
}
|
}
|
||||||
|
|
||||||
Array.set(this.array, this.lastItemIndex, o);
|
Array.set(array, lastItemIndex, o);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,9 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
throw new IllegalArgumentException("End index must not be less than start index");
|
throw new IllegalArgumentException("End index must not be less than start index");
|
||||||
}
|
}
|
||||||
this.array = array;
|
this.array = array;
|
||||||
this.startIndex = start;
|
startIndex = start;
|
||||||
this.endIndex = end;
|
endIndex = end;
|
||||||
this.index = start;
|
index = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,7 +103,7 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
* @return the array this iterator iterates over
|
* @return the array this iterator iterates over
|
||||||
*/
|
*/
|
||||||
public E[] getArray() {
|
public E[] getArray() {
|
||||||
return this.array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,7 +112,7 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
* @return the end index
|
* @return the end index
|
||||||
*/
|
*/
|
||||||
public int getEndIndex() {
|
public int getEndIndex() {
|
||||||
return this.endIndex;
|
return endIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +121,7 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
* @return the start index
|
* @return the start index
|
||||||
*/
|
*/
|
||||||
public int getStartIndex() {
|
public int getStartIndex() {
|
||||||
return this.startIndex;
|
return startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +131,7 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return this.index < this.endIndex;
|
return index < endIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -146,7 +146,7 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
if (!hasNext()) {
|
if (!hasNext()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
return this.array[this.index++];
|
return array[index++];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,7 +164,7 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
this.index = this.startIndex;
|
index = startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPrevious() {
|
public boolean hasPrevious() {
|
||||||
return this.index > getStartIndex();
|
return index > getStartIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -119,8 +119,8 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
if (!hasNext()) {
|
if (!hasNext()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
this.lastItemIndex = this.index;
|
lastItemIndex = index;
|
||||||
return this.array[this.index++];
|
return array[index++];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,7 +130,7 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int nextIndex() {
|
public int nextIndex() {
|
||||||
return this.index - getStartIndex();
|
return index - getStartIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,8 +144,8 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
if (!hasPrevious()) {
|
if (!hasPrevious()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
this.lastItemIndex = --this.index;
|
lastItemIndex = --index;
|
||||||
return this.array[this.index];
|
return array[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +155,7 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int previousIndex() {
|
public int previousIndex() {
|
||||||
return this.index - getStartIndex() - 1;
|
return index - getStartIndex() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,7 +164,7 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
super.reset();
|
super.reset();
|
||||||
this.lastItemIndex = -1;
|
lastItemIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -186,11 +186,11 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void set(final E obj) {
|
public void set(final E obj) {
|
||||||
if (this.lastItemIndex == -1) {
|
if (lastItemIndex == -1) {
|
||||||
throw new IllegalStateException("must call next() or previous() before a call to set()");
|
throw new IllegalStateException("must call next() or previous() before a call to set()");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.array[this.lastItemIndex] = obj;
|
array[lastItemIndex] = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -797,10 +797,10 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected void doReadObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
|
protected void doReadObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
this.keyType = ReferenceStrength.resolve(in.readInt());
|
keyType = ReferenceStrength.resolve(in.readInt());
|
||||||
this.valueType = ReferenceStrength.resolve(in.readInt());
|
valueType = ReferenceStrength.resolve(in.readInt());
|
||||||
this.purgeValues = in.readBoolean();
|
purgeValues = in.readBoolean();
|
||||||
this.loadFactor = in.readFloat();
|
loadFactor = in.readFloat();
|
||||||
final int capacity = in.readInt();
|
final int capacity = in.readInt();
|
||||||
init();
|
init();
|
||||||
data = new HashEntry[capacity];
|
data = new HashEntry[capacity];
|
||||||
|
@ -958,7 +958,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
|
||||||
* @return true if keyType has the specified type
|
* @return true if keyType has the specified type
|
||||||
*/
|
*/
|
||||||
protected boolean isKeyType(final ReferenceStrength type) {
|
protected boolean isKeyType(final ReferenceStrength type) {
|
||||||
return this.keyType == type;
|
return keyType == type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -967,7 +967,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
|
||||||
* @return true if valueType has the specified type
|
* @return true if valueType has the specified type
|
||||||
*/
|
*/
|
||||||
protected boolean isValueType(final ReferenceStrength type) {
|
protected boolean isValueType(final ReferenceStrength type) {
|
||||||
return this.valueType == type;
|
return valueType == type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1031,7 +1031,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
|
||||||
} else {
|
} else {
|
||||||
previous.next = entry.next;
|
previous.next = entry.next;
|
||||||
}
|
}
|
||||||
this.size--;
|
size--;
|
||||||
refEntry.onPurge();
|
refEntry.onPurge();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,17 +193,17 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
public synchronized void addComposited(final Map<K, V> map) throws IllegalArgumentException {
|
public synchronized void addComposited(final Map<K, V> map) throws IllegalArgumentException {
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
for (int i = composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
final Collection<K> intersect = CollectionUtils.intersection(this.composite[i].keySet(), map.keySet());
|
final Collection<K> intersect = CollectionUtils.intersection(composite[i].keySet(), map.keySet());
|
||||||
if (!intersect.isEmpty()) {
|
if (!intersect.isEmpty()) {
|
||||||
if (this.mutator == null) {
|
if (mutator == null) {
|
||||||
throw new IllegalArgumentException("Key collision adding Map to CompositeMap");
|
throw new IllegalArgumentException("Key collision adding Map to CompositeMap");
|
||||||
}
|
}
|
||||||
this.mutator.resolveCollision(this, this.composite[i], map, intersect);
|
mutator.resolveCollision(this, composite[i], map, intersect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Map<K, V>[] temp = Arrays.copyOf(this.composite, this.composite.length + 1);
|
final Map<K, V>[] temp = Arrays.copyOf(composite, composite.length + 1);
|
||||||
temp[temp.length - 1] = map;
|
temp[temp.length - 1] = map;
|
||||||
this.composite = temp;
|
composite = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,8 +214,8 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
this.composite[i].clear();
|
composite[i].clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,8 +237,8 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean containsKey(final Object key) {
|
public boolean containsKey(final Object key) {
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
if (this.composite[i].containsKey(key)) {
|
if (composite[i].containsKey(key)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,8 +263,8 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean containsValue(final Object value) {
|
public boolean containsValue(final Object value) {
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
if (this.composite[i].containsValue(value)) {
|
if (composite[i].containsValue(value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -338,9 +338,9 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public V get(final Object key) {
|
public V get(final Object key) {
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
if (this.composite[i].containsKey(key)) {
|
if (composite[i].containsKey(key)) {
|
||||||
return this.composite[i].get(key);
|
return composite[i].get(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -366,8 +366,8 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
if (!this.composite[i].isEmpty()) {
|
if (!composite[i].isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -392,8 +392,8 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
@Override
|
@Override
|
||||||
public Set<K> keySet() {
|
public Set<K> keySet() {
|
||||||
final CompositeSet<K> keys = new CompositeSet<>();
|
final CompositeSet<K> keys = new CompositeSet<>();
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
keys.addComposited(this.composite[i].keySet());
|
keys.addComposited(composite[i].keySet());
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
@ -425,10 +425,10 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public V put(final K key, final V value) {
|
public V put(final K key, final V value) {
|
||||||
if (this.mutator == null) {
|
if (mutator == null) {
|
||||||
throw new UnsupportedOperationException("No mutator specified");
|
throw new UnsupportedOperationException("No mutator specified");
|
||||||
}
|
}
|
||||||
return this.mutator.put(this, this.composite, key, value);
|
return mutator.put(this, composite, key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -455,10 +455,10 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void putAll(final Map<? extends K, ? extends V> map) {
|
public void putAll(final Map<? extends K, ? extends V> map) {
|
||||||
if (this.mutator == null) {
|
if (mutator == null) {
|
||||||
throw new UnsupportedOperationException("No mutator specified");
|
throw new UnsupportedOperationException("No mutator specified");
|
||||||
}
|
}
|
||||||
this.mutator.putAll(this, this.composite, map);
|
mutator.putAll(this, composite, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -488,9 +488,9 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public V remove(final Object key) {
|
public V remove(final Object key) {
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
if (this.composite[i].containsKey(key)) {
|
if (composite[i].containsKey(key)) {
|
||||||
return this.composite[i].remove(key);
|
return composite[i].remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -504,13 +504,13 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public synchronized Map<K, V> removeComposited(final Map<K, V> map) {
|
public synchronized Map<K, V> removeComposited(final Map<K, V> map) {
|
||||||
final int size = this.composite.length;
|
final int size = composite.length;
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
if (this.composite[i].equals(map)) {
|
if (composite[i].equals(map)) {
|
||||||
final Map<K, V>[] temp = new Map[size - 1];
|
final Map<K, V>[] temp = new Map[size - 1];
|
||||||
System.arraycopy(this.composite, 0, temp, 0, i);
|
System.arraycopy(composite, 0, temp, 0, i);
|
||||||
System.arraycopy(this.composite, i + 1, temp, i, size - i - 1);
|
System.arraycopy(composite, i + 1, temp, i, size - i - 1);
|
||||||
this.composite = temp;
|
composite = temp;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -536,8 +536,8 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
int size = 0;
|
int size = 0;
|
||||||
for (int i = this.composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
size += this.composite[i].size();
|
size += composite[i].size();
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
this.parent.clear();
|
parent.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,7 +131,7 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return this.parent.isEmpty();
|
return parent.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -155,7 +155,7 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return this.parent.size();
|
return parent.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -174,12 +174,12 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
this.parent.clear();
|
parent.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(final Object value) {
|
public boolean contains(final Object value) {
|
||||||
return this.parent.containsKey(value);
|
return parent.containsKey(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -194,7 +194,7 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return this.parent.size();
|
return parent.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,17 +334,17 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
this.parent.clear();
|
parent.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(final Object value) {
|
public boolean contains(final Object value) {
|
||||||
return this.parent.containsValue(value);
|
return parent.containsValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V get(final int index) {
|
public V get(final int index) {
|
||||||
return this.parent.getValue(index);
|
return parent.getValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -359,17 +359,17 @@ public class ListOrderedMap<K, V>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V remove(final int index) {
|
public V remove(final int index) {
|
||||||
return this.parent.remove(index);
|
return parent.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V set(final int index, final V value) {
|
public V set(final int index, final V value) {
|
||||||
return this.parent.setValue(index, value);
|
return parent.setValue(index, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return this.parent.size();
|
return parent.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ public class ListOrderedMap<K, V>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Set<Map.Entry<K, V>> entrySet() {
|
public Set<Map.Entry<K, V>> entrySet() {
|
||||||
return new EntrySetView<>(this, this.insertOrder);
|
return new EntrySetView<>(this, insertOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,10 +64,10 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
|
||||||
if (getMap().get(key) == null) {
|
if (getMap().get(key) == null) {
|
||||||
final List<V> list = createCollection();
|
final List<V> list = createCollection();
|
||||||
getMap().put(key, list);
|
getMap().put(key, list);
|
||||||
this.values = list;
|
values = list;
|
||||||
this.iterator = list.listIterator();
|
iterator = list.listIterator();
|
||||||
}
|
}
|
||||||
this.iterator.add(value);
|
iterator.add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -194,7 +194,7 @@ public class CompositeSet<E> implements Set<E>, Serializable {
|
||||||
for (final Set<E> existingSet : getSets()) {
|
for (final Set<E> existingSet : getSets()) {
|
||||||
final Collection<E> intersects = CollectionUtils.intersection(existingSet, set);
|
final Collection<E> intersects = CollectionUtils.intersection(existingSet, set);
|
||||||
if (!intersects.isEmpty()) {
|
if (!intersects.isEmpty()) {
|
||||||
if (this.mutator == null) {
|
if (mutator == null) {
|
||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"Collision adding composited set with no SetMutator set");
|
"Collision adding composited set with no SetMutator set");
|
||||||
}
|
}
|
||||||
|
|
|
@ -843,18 +843,18 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
|
||||||
* Resets the {@link #map}, {@link #entrySet}, {@link #keySet}, {@link #values} and {@link #confirmed} fields to empty.
|
* Resets the {@link #map}, {@link #entrySet}, {@link #keySet}, {@link #values} and {@link #confirmed} fields to empty.
|
||||||
*/
|
*/
|
||||||
public void resetEmpty() {
|
public void resetEmpty() {
|
||||||
this.map = makeObject();
|
map = makeObject();
|
||||||
views();
|
views();
|
||||||
this.confirmed = makeConfirmedMap();
|
confirmed = makeConfirmedMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the {@link #map}, {@link #entrySet}, {@link #keySet}, {@link #values} and {@link #confirmed} fields to full.
|
* Resets the {@link #map}, {@link #entrySet}, {@link #keySet}, {@link #values} and {@link #confirmed} fields to full.
|
||||||
*/
|
*/
|
||||||
public void resetFull() {
|
public void resetFull() {
|
||||||
this.map = makeFullMap();
|
map = makeFullMap();
|
||||||
views();
|
views();
|
||||||
this.confirmed = makeConfirmedMap();
|
confirmed = makeConfirmedMap();
|
||||||
final K[] k = getSampleKeys();
|
final K[] k = getSampleKeys();
|
||||||
final V[] v = getSampleValues();
|
final V[] v = getSampleValues();
|
||||||
for (int i = 0; i < k.length; i++) {
|
for (int i = 0; i < k.length; i++) {
|
||||||
|
@ -1920,10 +1920,10 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
|
||||||
* Resets the collection view fields.
|
* Resets the collection view fields.
|
||||||
*/
|
*/
|
||||||
private void views() {
|
private void views() {
|
||||||
this.keySet = getMap().keySet();
|
keySet = getMap().keySet();
|
||||||
// see verifyValues: retrieve the values collection only when verifying them
|
// see verifyValues: retrieve the values collection only when verifying them
|
||||||
// this.values = getMap().values();
|
// this.values = getMap().values();
|
||||||
this.entrySet = getMap().entrySet();
|
entrySet = getMap().entrySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class CompositeMapTest<K, V> extends AbstractIterableMapTest<K, V> {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
this.pass = false;
|
pass = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -669,16 +669,16 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
* Resets the {@link #map} and {@link #confirmed} fields to empty.
|
* Resets the {@link #map} and {@link #confirmed} fields to empty.
|
||||||
*/
|
*/
|
||||||
public void resetEmpty() {
|
public void resetEmpty() {
|
||||||
this.map = makeObject();
|
map = makeObject();
|
||||||
this.confirmed = makeConfirmedMap();
|
confirmed = makeConfirmedMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the {@link #map} and {@link #confirmed} fields to full.
|
* Resets the {@link #map} and {@link #confirmed} fields to full.
|
||||||
*/
|
*/
|
||||||
public void resetFull() {
|
public void resetFull() {
|
||||||
this.map = makeFullMap();
|
map = makeFullMap();
|
||||||
this.confirmed = makeConfirmedMap();
|
confirmed = makeConfirmedMap();
|
||||||
final K[] k = getSampleKeys();
|
final K[] k = getSampleKeys();
|
||||||
final V[] v = getSampleValues();
|
final V[] v = getSampleValues();
|
||||||
for (int i = 0; i < k.length; i++) {
|
for (int i = 0; i < k.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue