Compare commits
No commits in common. "54c9660145bf63094590e7c4c3266100f7ab7037" and "1f1aa995dfbea707cb7745af4ab944ade10b6178" have entirely different histories.
54c9660145
...
1f1aa995df
@ -184,7 +184,6 @@ public class GlobalVariables
|
|||||||
|
|
||||||
//Abstract Classes
|
//Abstract Classes
|
||||||
addAbstractMapper("ABSTRACT_COLLECTION", "Abstract%sCollection");
|
addAbstractMapper("ABSTRACT_COLLECTION", "Abstract%sCollection");
|
||||||
addAbstractMapper("ABSTRACT_PRIORITY_QUEUE", "Abstract%sPriorityQueue");
|
|
||||||
addAbstractMapper("ABSTRACT_SET", "Abstract%sSet");
|
addAbstractMapper("ABSTRACT_SET", "Abstract%sSet");
|
||||||
addAbstractMapper("ABSTRACT_LIST", "Abstract%sList");
|
addAbstractMapper("ABSTRACT_LIST", "Abstract%sList");
|
||||||
addAbstractBiMapper("ABSTRACT_MAP", "Abstract%sMap", "2");
|
addAbstractBiMapper("ABSTRACT_MAP", "Abstract%sMap", "2");
|
||||||
|
@ -78,7 +78,6 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
|
|||||||
nameRemapper.put("IArray", "I%sArray");
|
nameRemapper.put("IArray", "I%sArray");
|
||||||
nameRemapper.put("AbstractMap", "Abstract%sMap");
|
nameRemapper.put("AbstractMap", "Abstract%sMap");
|
||||||
nameRemapper.put("AbstractCollection", "Abstract%sCollection");
|
nameRemapper.put("AbstractCollection", "Abstract%sCollection");
|
||||||
nameRemapper.put("AbstractPriorityQueue", "Abstract%sPriorityQueue");
|
|
||||||
nameRemapper.put("AbstractSet", "Abstract%sSet");
|
nameRemapper.put("AbstractSet", "Abstract%sSet");
|
||||||
nameRemapper.put("AbstractList", "Abstract%sList");
|
nameRemapper.put("AbstractList", "Abstract%sList");
|
||||||
nameRemapper.put("EnumMap", "Enum2%sMap");
|
nameRemapper.put("EnumMap", "Enum2%sMap");
|
||||||
|
@ -35,9 +35,6 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle
|
|||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public COLLECTION KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
/** {@inheritDoc}
|
/** {@inheritDoc}
|
||||||
* <p>This default implementation delegates to the corresponding type-specific function.
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
||||||
|
@ -123,15 +123,6 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection<CLASS_TYPE>, ITE
|
|||||||
*/
|
*/
|
||||||
public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c);
|
public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c);
|
||||||
|
|
||||||
/**
|
|
||||||
* A Function that does a shallow clone of the Collection itself.
|
|
||||||
* This function is more optimized then a copy constructor since the Collection does not have to be unsorted/resorted.
|
|
||||||
* It can be compared to Cloneable but with less exception risk
|
|
||||||
* @return a Shallow Copy of the collection
|
|
||||||
* @note Wrappers and view collections will not support this feature
|
|
||||||
*/
|
|
||||||
public COLLECTION KEY_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
/**
|
/**
|
||||||
* A Type-Specific toArray function that delegates to {@link #TO_ARRAY(KEY_TYPE[])} with a newly created array.
|
* A Type-Specific toArray function that delegates to {@link #TO_ARRAY(KEY_TYPE[])} with a newly created array.
|
||||||
|
@ -229,8 +229,6 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION
|
|||||||
while(size < size()) REMOVE(size() - 1);
|
while(size < size()) REMOVE(size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ABSTRACT_LIST KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
private class SUB_LIST extends ABSTRACT_LIST KEY_GENERIC_TYPE {
|
private class SUB_LIST extends ABSTRACT_LIST KEY_GENERIC_TYPE {
|
||||||
ABSTRACT_LIST KEY_GENERIC_TYPE l;
|
ABSTRACT_LIST KEY_GENERIC_TYPE l;
|
||||||
int offset;
|
int offset;
|
||||||
|
@ -1015,14 +1015,6 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
|
|||||||
grow(size);
|
grow(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ARRAY_LIST KEY_GENERIC_TYPE copy() {
|
|
||||||
ARRAY_LIST KEY_GENERIC_TYPE list = new ARRAY_LISTBRACES();
|
|
||||||
list.data = Arrays.copyOf(data, data.length);
|
|
||||||
list.size = size;
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void grow(int capacity) {
|
protected void grow(int capacity) {
|
||||||
if(capacity < data.length) return;
|
if(capacity < data.length) return;
|
||||||
data = Arrays.copyOf(data, data == ARRAYS.EMPTY_ARRAY ? Math.max(DEFAULT_ARRAY_SIZE, capacity) : (int)Math.max(Math.min((long)data.length + (data.length >> 1), SanityChecks.MAX_ARRAY_SIZE), capacity));
|
data = Arrays.copyOf(data, data == ARRAYS.EMPTY_ARRAY ? Math.max(DEFAULT_ARRAY_SIZE, capacity) : (int)Math.max(Math.min((long)data.length + (data.length >> 1), SanityChecks.MAX_ARRAY_SIZE), capacity));
|
||||||
|
@ -261,11 +261,6 @@ public class IMMUTABLE_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_T
|
|||||||
return data[index];
|
return data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IMMUTABLE_LIST KEY_GENERIC_TYPE copy() {
|
|
||||||
return new IMMUTABLE_LISTBRACES(Arrays.copyOf(data, data.length));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Type Specific foreach function that reduces (un)boxing
|
* A Type Specific foreach function that reduces (un)boxing
|
||||||
*
|
*
|
||||||
|
@ -820,23 +820,6 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
|
|||||||
size = 0;
|
size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LINKED_LIST KEY_GENERIC_TYPE copy() {
|
|
||||||
LINKED_LIST KEY_GENERIC_TYPE list = new LINKED_LISTBRACES();
|
|
||||||
list.size = size;
|
|
||||||
if(first != null) {
|
|
||||||
list.first = new EntryBRACES(first.value, null, null);
|
|
||||||
Entry KEY_GENERIC_TYPE lastReturned = list.first;
|
|
||||||
for(Entry KEY_GENERIC_TYPE entry = first.next;entry != null;entry = entry.next) {
|
|
||||||
Entry KEY_GENERIC_TYPE next = new EntryBRACES(entry.value, lastReturned, null);
|
|
||||||
lastReturned.next = next;
|
|
||||||
lastReturned = next;
|
|
||||||
}
|
|
||||||
list.last = lastReturned;
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Entry KEY_GENERIC_TYPE getNode(int index) {
|
protected Entry KEY_GENERIC_TYPE getNode(int index) {
|
||||||
if(index < size >> 2) {
|
if(index < size >> 2) {
|
||||||
Entry KEY_GENERIC_TYPE x = first;
|
Entry KEY_GENERIC_TYPE x = first;
|
||||||
|
@ -339,8 +339,6 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
|
|||||||
*/
|
*/
|
||||||
public void size(int size);
|
public void size(int size);
|
||||||
|
|
||||||
@Override
|
|
||||||
public LIST KEY_GENERIC_TYPE copy();
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
|
|
||||||
/** {@inheritDoc}
|
/** {@inheritDoc}
|
||||||
|
@ -47,11 +47,6 @@ public abstract class ABSTRACT_MAP KEY_VALUE_GENERIC_TYPE extends AbstractMap<CL
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT || !VALUE_OBJECT
|
#if !TYPE_OBJECT || !VALUE_OBJECT
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package speiger.src.collections.PACKAGE.maps.impl.customHash;
|
package speiger.src.collections.PACKAGE.maps.impl.customHash;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
@ -337,23 +336,6 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
|||||||
return values[index];
|
return values[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE map = new LINKED_CUSTOM_HASH_MAPKV_BRACES(0, loadFactor, strategy);
|
|
||||||
map.minCapacity = minCapacity;
|
|
||||||
map.mask = mask;
|
|
||||||
map.maxFill = maxFill;
|
|
||||||
map.nullIndex = nullIndex;
|
|
||||||
map.containsNull = containsNull;
|
|
||||||
map.size = size;
|
|
||||||
map.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
map.values = Arrays.copyOf(values, values.length);
|
|
||||||
map.links = Arrays.copyOf(links, links.length);
|
|
||||||
map.firstIndex = firstIndex;
|
|
||||||
map.lastIndex = lastIndex;
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
||||||
return null;
|
return null;
|
||||||
@ -671,9 +653,6 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
|||||||
return new FastEntryIterator(fromElement);
|
return new FastEntryIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MapEntrySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||||
int index = firstIndex;
|
int index = firstIndex;
|
||||||
@ -882,9 +861,6 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
|||||||
return new KeyIterator(fromElement);
|
return new KeyIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return LINKED_CUSTOM_HASH_MAP.this.size();
|
return LINKED_CUSTOM_HASH_MAP.this.size();
|
||||||
|
@ -423,20 +423,6 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE map = new CUSTOM_HASH_MAPKV_BRACES(0, loadFactor, strategy);
|
|
||||||
map.minCapacity = minCapacity;
|
|
||||||
map.mask = mask;
|
|
||||||
map.maxFill = maxFill;
|
|
||||||
map.nullIndex = nullIndex;
|
|
||||||
map.containsNull = containsNull;
|
|
||||||
map.size = size;
|
|
||||||
map.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
map.values = Arrays.copyOf(values, values.length);
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() {
|
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() {
|
||||||
if(entrySet == null) entrySet = new MapEntrySet();
|
if(entrySet == null) entrySet = new MapEntrySet();
|
||||||
@ -978,9 +964,6 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
|
|||||||
return new KeyIterator();
|
return new KeyIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return CUSTOM_HASH_MAP.this.size();
|
return CUSTOM_HASH_MAP.this.size();
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package speiger.src.collections.PACKAGE.maps.impl.hash;
|
package speiger.src.collections.PACKAGE.maps.impl.hash;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
@ -314,23 +313,6 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
|||||||
return values[index];
|
return values[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE map = new LINKED_HASH_MAPKV_BRACES(0, loadFactor);
|
|
||||||
map.minCapacity = minCapacity;
|
|
||||||
map.mask = mask;
|
|
||||||
map.maxFill = maxFill;
|
|
||||||
map.nullIndex = nullIndex;
|
|
||||||
map.containsNull = containsNull;
|
|
||||||
map.size = size;
|
|
||||||
map.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
map.values = Arrays.copyOf(values, values.length);
|
|
||||||
map.links = Arrays.copyOf(links, links.length);
|
|
||||||
map.firstIndex = firstIndex;
|
|
||||||
map.lastIndex = lastIndex;
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
||||||
return null;
|
return null;
|
||||||
@ -648,9 +630,6 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
|||||||
return new FastEntryIterator(fromElement);
|
return new FastEntryIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MapEntrySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||||
int index = firstIndex;
|
int index = firstIndex;
|
||||||
@ -859,9 +838,6 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
|||||||
return new KeyIterator(fromElement);
|
return new KeyIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return LINKED_HASH_MAP.this.size();
|
return LINKED_HASH_MAP.this.size();
|
||||||
|
@ -383,21 +383,7 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
|
|||||||
return slot < 0 ? defaultValue : values[slot];
|
return slot < 0 ? defaultValue : values[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public HASH_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
HASH_MAP KEY_VALUE_GENERIC_TYPE map = new HASH_MAPKV_BRACES(0, loadFactor);
|
|
||||||
map.minCapacity = minCapacity;
|
|
||||||
map.mask = mask;
|
|
||||||
map.maxFill = maxFill;
|
|
||||||
map.nullIndex = nullIndex;
|
|
||||||
map.containsNull = containsNull;
|
|
||||||
map.size = size;
|
|
||||||
map.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
map.values = Arrays.copyOf(values, values.length);
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() {
|
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() {
|
||||||
if(entrySet == null) entrySet = new MapEntrySet();
|
if(entrySet == null) entrySet = new MapEntrySet();
|
||||||
@ -948,9 +934,6 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
|
|||||||
HASH_MAP.this.clear();
|
HASH_MAP.this.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
||||||
if(containsNull) action.accept(keys[nullIndex]);
|
if(containsNull) action.accept(keys[nullIndex]);
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package speiger.src.collections.PACKAGE.maps.impl.immutable;
|
package speiger.src.collections.PACKAGE.maps.impl.immutable;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -104,10 +103,6 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
|||||||
/** Amount of Elements stored in the HashMap */
|
/** Amount of Elements stored in the HashMap */
|
||||||
protected int size;
|
protected int size;
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor for copying the Map
|
|
||||||
*/
|
|
||||||
protected IMMUTABLE_HASH_MAP() {}
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT || !VALUE_OBJECT
|
#if !TYPE_OBJECT || !VALUE_OBJECT
|
||||||
/**
|
/**
|
||||||
@ -417,21 +412,6 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
|||||||
return valuesC;
|
return valuesC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE map = new IMMUTABLE_HASH_MAPKV_BRACES();
|
|
||||||
map.mask = mask;
|
|
||||||
map.nullIndex = nullIndex;
|
|
||||||
map.containsNull = containsNull;
|
|
||||||
map.size = size;
|
|
||||||
map.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
map.values = Arrays.copyOf(values, values.length);
|
|
||||||
map.links = Arrays.copyOf(links, links.length);
|
|
||||||
map.firstIndex = firstIndex;
|
|
||||||
map.lastIndex = lastIndex;
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
||||||
@Override
|
@Override
|
||||||
@ -609,9 +589,6 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
|||||||
return new FastEntryIterator(fromElement);
|
return new FastEntryIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MapEntrySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||||
int index = firstIndex;
|
int index = firstIndex;
|
||||||
@ -796,9 +773,6 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
|||||||
return new KeyIterator(fromElement);
|
return new KeyIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return IMMUTABLE_HASH_MAP.this.size();
|
return IMMUTABLE_HASH_MAP.this.size();
|
||||||
|
@ -554,14 +554,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
|||||||
size = 0;
|
size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ARRAY_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
ARRAY_MAP KEY_VALUE_GENERIC_TYPE map = new ARRAY_MAPKV_BRACES();
|
|
||||||
map.size = size;
|
|
||||||
map.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
map.values = Arrays.copyOf(values, keys.length);
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
||||||
return null;
|
return null;
|
||||||
@ -989,11 +981,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
|||||||
return entrySet;
|
return entrySet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubMap copy() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
||||||
return null;
|
return null;
|
||||||
@ -1146,9 +1133,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
|||||||
return new SubFastEntryIterator(fromElement);
|
return new SubFastEntryIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubMapEntrySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
@ -1332,9 +1316,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
|||||||
@Override
|
@Override
|
||||||
public KEY_TYPE POLL_LAST_KEY() { return POLL_LAST_ENTRY_KEY(); }
|
public KEY_TYPE POLL_LAST_KEY() { return POLL_LAST_ENTRY_KEY(); }
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubKeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
@ -1717,9 +1698,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
|||||||
return new FastEntryIterator(fromElement);
|
return new FastEntryIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MapEntrySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
@ -1904,9 +1882,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
|||||||
@Override
|
@Override
|
||||||
public KEY_TYPE POLL_LAST_KEY() { return POLL_LAST_ENTRY_KEY(); }
|
public KEY_TYPE POLL_LAST_KEY() { return POLL_LAST_ENTRY_KEY(); }
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
|
@ -176,15 +176,6 @@ public class ENUM_MAP KEY_ENUM_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public ENUM_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
ENUM_MAP KEY_VALUE_GENERIC_TYPE map = new ENUM_MAPKV_BRACES(keyType);
|
|
||||||
map.size = size;
|
|
||||||
System.arraycopy(present, 0, map.present, 0, Math.min(present.length, map.present.length));
|
|
||||||
System.arraycopy(values, 0, map.values, 0, Math.min(values.length, map.values.length));
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() {
|
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() {
|
||||||
if(entrySet == null) entrySet = new EntrySet();
|
if(entrySet == null) entrySet = new EntrySet();
|
||||||
|
@ -127,18 +127,6 @@ public class LINKED_ENUM_MAP KEY_ENUM_VALUE_GENERIC_TYPE extends ENUM_MAP KEY_VA
|
|||||||
return values[index];
|
return values[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LINKED_ENUM_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
LINKED_ENUM_MAP KEY_VALUE_GENERIC_TYPE map = new LINKED_ENUM_MAPKV_BRACES(keyType);
|
|
||||||
map.size = size;
|
|
||||||
System.arraycopy(present, 0, map.present, 0, Math.min(present.length, map.present.length));
|
|
||||||
System.arraycopy(values, 0, map.values, 0, Math.min(values.length, map.values.length));
|
|
||||||
System.arraycopy(links, 0, map.links, 0, Math.min(links.length, map.links.length));
|
|
||||||
map.firstIndex = firstIndex;
|
|
||||||
map.lastIndex = lastIndex;
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
||||||
return null;
|
return null;
|
||||||
@ -363,8 +351,6 @@ public class LINKED_ENUM_MAP KEY_ENUM_VALUE_GENERIC_TYPE extends ENUM_MAP KEY_VA
|
|||||||
return new FastEntryIterator(fromElement);
|
return new FastEntryIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapEntrySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
public void forEach(Consumer<? super MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||||
int index = firstIndex;
|
int index = firstIndex;
|
||||||
@ -491,8 +477,6 @@ public class LINKED_ENUM_MAP KEY_ENUM_VALUE_GENERIC_TYPE extends ENUM_MAP KEY_VA
|
|||||||
return new KeyIterator(fromElement);
|
return new KeyIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeySet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return LINKED_ENUM_MAP.this.size();
|
return LINKED_ENUM_MAP.this.size();
|
||||||
|
@ -610,21 +610,6 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
|||||||
return new KeyIterator(findNode(key));
|
return new KeyIterator(findNode(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE set = new AVL_TREE_MAPKV_BRACES();
|
|
||||||
set.size = size;
|
|
||||||
if(tree != null) {
|
|
||||||
set.tree = tree.copy();
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE lastFound = null;
|
|
||||||
for(Entry KEY_VALUE_GENERIC_TYPE entry = tree;entry != null;entry = entry.left) lastFound = entry;
|
|
||||||
set.first = lastFound;
|
|
||||||
lastFound = null;
|
|
||||||
for(Entry KEY_VALUE_GENERIC_TYPE entry = tree;entry != null;entry = entry.right) lastFound = entry;
|
|
||||||
set.last = lastFound;
|
|
||||||
}
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SORTED_SET KEY_GENERIC_TYPE keySet() {
|
public SORTED_SET KEY_GENERIC_TYPE keySet() {
|
||||||
return navigableKeySet();
|
return navigableKeySet();
|
||||||
@ -1148,8 +1133,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
|||||||
abstract AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE next(AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
abstract AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE next(AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
||||||
abstract AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE previous(AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
abstract AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE previous(AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
||||||
|
|
||||||
@Override
|
|
||||||
public NavigableSubMap KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
@Override
|
@Override
|
||||||
public abstract NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE descendingMap();
|
public abstract NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE descendingMap();
|
||||||
@Override
|
@Override
|
||||||
@ -1968,9 +1952,6 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public KeySet KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) {
|
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) {
|
||||||
return new KeySetKV_BRACES(m.subMap(fromElement, fromInclusive, toElement, toInclusive));
|
return new KeySetKV_BRACES(m.subMap(fromElement, fromInclusive, toElement, toInclusive));
|
||||||
@ -2339,22 +2320,6 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE entry = new EntryKV_BRACES(key, value, null);
|
|
||||||
entry.state = state;
|
|
||||||
if(left != null) {
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE newLeft = left.copy();
|
|
||||||
entry.left = newLeft;
|
|
||||||
newLeft.parent = entry;
|
|
||||||
}
|
|
||||||
if(right != null) {
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE newRight = right.copy();
|
|
||||||
entry.right = newRight;
|
|
||||||
newRight.parent = entry;
|
|
||||||
}
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE ENTRY_KEY() {
|
public KEY_TYPE ENTRY_KEY() {
|
||||||
return key;
|
return key;
|
||||||
|
@ -609,21 +609,6 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
|||||||
return new KeyIterator(findNode(key));
|
return new KeyIterator(findNode(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public RB_TREE_MAP KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
RB_TREE_MAP KEY_VALUE_GENERIC_TYPE set = new RB_TREE_MAPKV_BRACES();
|
|
||||||
set.size = size;
|
|
||||||
if(tree != null) {
|
|
||||||
set.tree = tree.copy();
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE lastFound = null;
|
|
||||||
for(Entry KEY_VALUE_GENERIC_TYPE entry = tree;entry != null;entry = entry.left) lastFound = entry;
|
|
||||||
set.first = lastFound;
|
|
||||||
lastFound = null;
|
|
||||||
for(Entry KEY_VALUE_GENERIC_TYPE entry = tree;entry != null;entry = entry.right) lastFound = entry;
|
|
||||||
set.last = lastFound;
|
|
||||||
}
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SORTED_SET KEY_GENERIC_TYPE keySet() {
|
public SORTED_SET KEY_GENERIC_TYPE keySet() {
|
||||||
return navigableKeySet();
|
return navigableKeySet();
|
||||||
@ -1202,8 +1187,6 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
|||||||
abstract RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE next(RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
abstract RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE next(RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
||||||
abstract RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE previous(RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
abstract RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE previous(RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry);
|
||||||
|
|
||||||
@Override
|
|
||||||
public NavigableSubMap KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
@Override
|
@Override
|
||||||
public abstract NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE descendingMap();
|
public abstract NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE descendingMap();
|
||||||
@Override
|
@Override
|
||||||
@ -2035,9 +2018,6 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public KeySet KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) {
|
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) {
|
||||||
return new KeySetKV_BRACES(m.subMap(fromElement, fromInclusive, toElement, toInclusive));
|
return new KeySetKV_BRACES(m.subMap(fromElement, fromInclusive, toElement, toInclusive));
|
||||||
@ -2408,22 +2388,6 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE copy() {
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE entry = new EntryKV_BRACES(key, value, null);
|
|
||||||
entry.state = state;
|
|
||||||
if(left != null) {
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE newLeft = left.copy();
|
|
||||||
entry.left = newLeft;
|
|
||||||
newLeft.parent = entry;
|
|
||||||
}
|
|
||||||
if(right != null) {
|
|
||||||
Entry KEY_VALUE_GENERIC_TYPE newRight = right.copy();
|
|
||||||
entry.right = newRight;
|
|
||||||
newRight.parent = entry;
|
|
||||||
}
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE ENTRY_KEY() {
|
public KEY_TYPE ENTRY_KEY() {
|
||||||
return key;
|
return key;
|
||||||
|
@ -59,15 +59,6 @@ public interface MAP KEY_VALUE_GENERIC_TYPE extends Map<CLASS_TYPE, CLASS_VALUE_
|
|||||||
*/
|
*/
|
||||||
public MAP KEY_VALUE_GENERIC_TYPE setDefaultReturnValue(VALUE_TYPE v);
|
public MAP KEY_VALUE_GENERIC_TYPE setDefaultReturnValue(VALUE_TYPE v);
|
||||||
|
|
||||||
/**
|
|
||||||
* A Function that does a shallow clone of the Map itself.
|
|
||||||
* This function is more optimized then a copy constructor since the Map does not have to be unsorted/resorted.
|
|
||||||
* It can be compared to Cloneable but with less exception risk
|
|
||||||
* @return a Shallow Copy of the Map
|
|
||||||
* @note Wrappers and view Maps will not support this feature
|
|
||||||
*/
|
|
||||||
public MAP KEY_VALUE_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type Specific method to reduce boxing/unboxing of values
|
* Type Specific method to reduce boxing/unboxing of values
|
||||||
* @param key the key that should be inserted,
|
* @param key the key that should be inserted,
|
||||||
|
@ -10,8 +10,6 @@ import speiger.src.collections.PACKAGE.sets.NAVIGABLE_SET;
|
|||||||
*/
|
*/
|
||||||
public interface NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE extends SORTED_MAP KEY_VALUE_GENERIC_TYPE, NavigableMap<CLASS_TYPE, CLASS_VALUE_TYPE>
|
public interface NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE extends SORTED_MAP KEY_VALUE_GENERIC_TYPE, NavigableMap<CLASS_TYPE, CLASS_VALUE_TYPE>
|
||||||
{
|
{
|
||||||
@Override
|
|
||||||
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE copy();
|
|
||||||
/** @return a Type Specific desendingMap */
|
/** @return a Type Specific desendingMap */
|
||||||
@Override
|
@Override
|
||||||
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE descendingMap();
|
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE descendingMap();
|
||||||
|
@ -75,9 +75,6 @@ public interface SORTED_MAP KEY_VALUE_GENERIC_TYPE extends SortedMap<CLASS_TYPE,
|
|||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator();
|
public COMPARATOR KEY_GENERIC_TYPE comparator();
|
||||||
|
|
||||||
@Override
|
|
||||||
public SORTED_MAP KEY_VALUE_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SET KEY_GENERIC_TYPE keySet();
|
public SET KEY_GENERIC_TYPE keySet();
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
package speiger.src.collections.PACKAGE.queues;
|
|
||||||
|
|
||||||
#if TYPE_OBJECT
|
|
||||||
import java.util.Objects;
|
|
||||||
#endif
|
|
||||||
import java.util.StringJoiner;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper class that implements all the essential methods for the PriorityQueues
|
|
||||||
* @Type(T)
|
|
||||||
*/
|
|
||||||
public abstract class ABSTRACT_PRIORITY_QUEUE KEY_GENERIC_TYPE implements PRIORITY_QUEUE KEY_GENERIC_TYPE
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if(obj instanceof PRIORITY_QUEUE) {
|
|
||||||
PRIORITY_QUEUE KEY_GENERIC_TYPE queue = (PRIORITY_QUEUE KEY_GENERIC_TYPE)obj;
|
|
||||||
if(queue.size() != size()) return false;
|
|
||||||
for(int i = 0,m=size();i<m;i++) {
|
|
||||||
if(KEY_EQUALS_NOT(queue.peek(i), peek(i))) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
int result = 1;
|
|
||||||
for (int i = 0,m=size();i<m;i++) {
|
|
||||||
result = 31 * result + KEY_TO_HASH(peek(i));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
if(isEmpty()) return "[]";
|
|
||||||
StringJoiner joiner = new StringJoiner(", ", "[", "]");
|
|
||||||
for (int i = 0,m=size();i<m;i++) {
|
|
||||||
joiner.add(KEY_TO_STRING(peek(i)));
|
|
||||||
}
|
|
||||||
return joiner.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
package speiger.src.collections.PACKAGE.queues;
|
package speiger.src.collections.PACKAGE.queues;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
#if TYPE_OBJECT
|
#if TYPE_OBJECT
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
#endif
|
#endif
|
||||||
@ -22,7 +22,7 @@ import speiger.src.collections.utils.ITrimmable;
|
|||||||
* Its specific implementation uses a backing array that grows and shrinks as it is needed.
|
* Its specific implementation uses a backing array that grows and shrinks as it is needed.
|
||||||
* @Type(T)
|
* @Type(T)
|
||||||
*/
|
*/
|
||||||
public class ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEUE KEY_GENERIC_TYPE implements PRIORITY_DEQUEUE KEY_GENERIC_TYPE, ITrimmable
|
public class ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE implements PRIORITY_DEQUEUE KEY_GENERIC_TYPE, ITrimmable
|
||||||
{
|
{
|
||||||
/** Max Possible ArraySize without the JVM Crashing */
|
/** Max Possible ArraySize without the JVM Crashing */
|
||||||
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
|
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
|
||||||
@ -222,15 +222,6 @@ public class ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEUE K
|
|||||||
@Override
|
@Override
|
||||||
public void onChanged() {}
|
public void onChanged() {}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE copy() {
|
|
||||||
ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE queue = new ARRAY_FIFO_QUEUEBRACES();
|
|
||||||
queue.first = first;
|
|
||||||
queue.last = last;
|
|
||||||
queue.array = Arrays.copyOf(array, array.length);
|
|
||||||
return queue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() { return null; }
|
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() { return null; }
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import speiger.src.collections.PACKAGE.utils.ARRAYS;
|
|||||||
* It is highly suggested to use HeapPriorityQueue otherwise, unless you know why you need this specific implementation
|
* It is highly suggested to use HeapPriorityQueue otherwise, unless you know why you need this specific implementation
|
||||||
* @Type(T)
|
* @Type(T)
|
||||||
*/
|
*/
|
||||||
public class ARRAY_PRIORITY_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEUE KEY_GENERIC_TYPE
|
public class ARRAY_PRIORITY_QUEUE KEY_GENERIC_TYPE implements PRIORITY_QUEUE KEY_GENERIC_TYPE
|
||||||
{
|
{
|
||||||
/** The Backing Array */
|
/** The Backing Array */
|
||||||
protected transient KEY_TYPE[] array = EMPTY_KEY_ARRAY;
|
protected transient KEY_TYPE[] array = EMPTY_KEY_ARRAY;
|
||||||
@ -322,16 +322,6 @@ public class ARRAY_PRIORITY_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUE
|
|||||||
return new Iter();
|
return new Iter();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ARRAY_PRIORITY_QUEUE KEY_GENERIC_TYPE copy() {
|
|
||||||
ARRAY_PRIORITY_QUEUE KEY_GENERIC_TYPE queue = new ARRAY_PRIORITY_QUEUEBRACES();
|
|
||||||
queue.firstIndex = firstIndex;
|
|
||||||
queue.size = size;
|
|
||||||
queue.comparator = comparator;
|
|
||||||
queue.array = Arrays.copyOf(array, array.length);
|
|
||||||
return queue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() {
|
||||||
return comparator;
|
return comparator;
|
||||||
|
@ -23,7 +23,7 @@ import speiger.src.collections.PACKAGE.utils.ARRAYS;
|
|||||||
* It is a ArrayBased Alternative to TreeSets that has less object allocations
|
* It is a ArrayBased Alternative to TreeSets that has less object allocations
|
||||||
* @Type(T)
|
* @Type(T)
|
||||||
*/
|
*/
|
||||||
public class HEAP_PRIORITY_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEUE KEY_GENERIC_TYPE
|
public class HEAP_PRIORITY_QUEUE KEY_GENERIC_TYPE implements PRIORITY_QUEUE KEY_GENERIC_TYPE
|
||||||
{
|
{
|
||||||
/** The Backing Array */
|
/** The Backing Array */
|
||||||
protected transient KEY_TYPE[] array = EMPTY_KEY_ARRAY;
|
protected transient KEY_TYPE[] array = EMPTY_KEY_ARRAY;
|
||||||
@ -319,15 +319,6 @@ public class HEAP_PRIORITY_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEU
|
|||||||
ARRAYS.shiftDown(array, size, 0, comparator);
|
ARRAYS.shiftDown(array, size, 0, comparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HEAP_PRIORITY_QUEUE KEY_GENERIC_TYPE copy() {
|
|
||||||
HEAP_PRIORITY_QUEUE KEY_GENERIC_TYPE queue = new HEAP_PRIORITY_QUEUEBRACES();
|
|
||||||
queue.size = size;
|
|
||||||
queue.comparator = comparator;
|
|
||||||
queue.array = Arrays.copyOf(array, array.length);
|
|
||||||
return queue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() {
|
||||||
return comparator;
|
return comparator;
|
||||||
|
@ -22,7 +22,4 @@ public interface PRIORITY_DEQUEUE KEY_GENERIC_TYPE extends PRIORITY_QUEUE KEY_GE
|
|||||||
* @return the Last Element within the dequeue without deleting it
|
* @return the Last Element within the dequeue without deleting it
|
||||||
*/
|
*/
|
||||||
public default KEY_TYPE last() { return peek(size()-1); }
|
public default KEY_TYPE last() { return peek(size()-1); }
|
||||||
|
|
||||||
@Override
|
|
||||||
public PRIORITY_DEQUEUE KEY_GENERIC_TYPE copy();
|
|
||||||
}
|
}
|
@ -70,15 +70,6 @@ public interface PRIORITY_QUEUE KEY_GENERIC_TYPE extends ITERABLE KEY_GENERIC_TY
|
|||||||
*/
|
*/
|
||||||
public void onChanged();
|
public void onChanged();
|
||||||
|
|
||||||
/**
|
|
||||||
* A Function that does a shallow clone of the PriorityQueue itself.
|
|
||||||
* This function is more optimized then a copy constructor since the PriorityQueue does not have to be unsorted/resorted.
|
|
||||||
* It can be compared to Cloneable but with less exception risk
|
|
||||||
* @return a Shallow Copy of the PriorityQueue
|
|
||||||
* @note Wrappers and view PriorityQueues will not support this feature
|
|
||||||
*/
|
|
||||||
public PRIORITY_QUEUE KEY_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the sorter of the Queue, can be null
|
* @return the sorter of the Queue, can be null
|
||||||
*/
|
*/
|
||||||
|
@ -538,21 +538,6 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
|||||||
tree = null;
|
tree = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AVL_TREE_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
AVL_TREE_SET KEY_GENERIC_TYPE set = new AVL_TREE_SETBRACES();
|
|
||||||
set.size = size;
|
|
||||||
if(tree != null) {
|
|
||||||
set.tree = tree.copy();
|
|
||||||
Entry KEY_GENERIC_TYPE lastFound = null;
|
|
||||||
for(Entry KEY_GENERIC_TYPE entry = tree;entry != null;entry = entry.left) lastFound = entry;
|
|
||||||
set.first = lastFound;
|
|
||||||
lastFound = null;
|
|
||||||
for(Entry KEY_GENERIC_TYPE entry = tree;entry != null;entry = entry.right) lastFound = entry;
|
|
||||||
set.last = lastFound;
|
|
||||||
}
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() { return comparator; }
|
public COMPARATOR KEY_GENERIC_TYPE comparator() { return comparator; }
|
||||||
|
|
||||||
@ -1024,9 +1009,6 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
|||||||
return fromStart && toEnd ? set.size() : iterator().skip(Integer.MAX_VALUE);
|
return fromStart && toEnd ? set.size() : iterator().skip(Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubSet KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
@ -1268,22 +1250,6 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry KEY_GENERIC_TYPE copy() {
|
|
||||||
Entry KEY_GENERIC_TYPE entry = new EntryBRACES(key, null);
|
|
||||||
entry.state = state;
|
|
||||||
if(left != null) {
|
|
||||||
Entry KEY_GENERIC_TYPE newLeft = left.copy();
|
|
||||||
entry.left = newLeft;
|
|
||||||
newLeft.parent = entry;
|
|
||||||
}
|
|
||||||
if(right != null) {
|
|
||||||
Entry KEY_GENERIC_TYPE newRight = right.copy();
|
|
||||||
entry.right = newRight;
|
|
||||||
newRight.parent = entry;
|
|
||||||
}
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getHeight() { return state; }
|
int getHeight() { return state; }
|
||||||
|
|
||||||
void updateHeight() { state = (1 + Math.max(left == null ? -1 : left.getHeight(), right == null ? -1 : right.getHeight())); }
|
void updateHeight() { state = (1 + Math.max(left == null ? -1 : left.getHeight(), right == null ? -1 : right.getHeight())); }
|
||||||
|
@ -15,8 +15,6 @@ public abstract class ABSTRACT_SET KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION
|
|||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public abstract ITERATOR KEY_GENERIC_TYPE iterator();
|
public abstract ITERATOR KEY_GENERIC_TYPE iterator();
|
||||||
@Override
|
|
||||||
public ABSTRACT_SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
@ -450,13 +450,6 @@ public class ARRAY_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE im
|
|||||||
return new SubSet(fromIndex, size - fromIndex);
|
return new SubSet(fromIndex, size - fromIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ARRAY_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
ARRAY_SET KEY_GENERIC_TYPE set = new ARRAY_SETBRACES();
|
|
||||||
set.data = Arrays.copyOf(data, data.length);
|
|
||||||
set.size = size;
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
public COMPARATOR KEY_GENERIC_TYPE comparator() {
|
||||||
return null;
|
return null;
|
||||||
@ -682,10 +675,7 @@ public class ARRAY_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE im
|
|||||||
if(index != -1) return new SetIterator(index);
|
if(index != -1) return new SetIterator(index);
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubSet copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SORTED_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, KEY_TYPE toElement) {
|
public SORTED_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, KEY_TYPE toElement) {
|
||||||
int fromIndex = findIndex(fromElement);
|
int fromIndex = findIndex(fromElement);
|
||||||
|
@ -4,7 +4,6 @@ package speiger.src.collections.PACKAGE.sets;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
#endif
|
#endif
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
@ -51,12 +50,6 @@ public class IMMUTABLE_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERI
|
|||||||
/** The Last Index in the Map */
|
/** The Last Index in the Map */
|
||||||
protected int lastIndex = -1;
|
protected int lastIndex = -1;
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor to optimize the copying
|
|
||||||
* Only accessible through implementations
|
|
||||||
*/
|
|
||||||
protected IMMUTABLE_HASH_SET() {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper constructor that allow to create a set from unboxed values
|
* Helper constructor that allow to create a set from unboxed values
|
||||||
* @param array the elements that should be put into the set
|
* @param array the elements that should be put into the set
|
||||||
@ -379,20 +372,6 @@ public class IMMUTABLE_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERI
|
|||||||
return new SetIterator(fromElement);
|
return new SetIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IMMUTABLE_HASH_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
IMMUTABLE_HASH_SET KEY_GENERIC_TYPE set = new IMMUTABLE_HASH_SETBRACES();
|
|
||||||
set.containsNull = containsNull;
|
|
||||||
set.firstIndex = firstIndex;
|
|
||||||
set.lastIndex = lastIndex;
|
|
||||||
set.size = size;
|
|
||||||
set.mask = mask;
|
|
||||||
set.nullIndex = nullIndex;
|
|
||||||
set.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
set.links = Arrays.copyOf(links, links.length);
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ package speiger.src.collections.PACKAGE.sets;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
#endif
|
#endif
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -610,22 +609,6 @@ public class LINKED_CUSTOM_HASH_SET KEY_GENERIC_TYPE extends CUSTOM_HASH_SET KEY
|
|||||||
return new SetIterator(fromElement);
|
return new SetIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LINKED_CUSTOM_HASH_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
LINKED_CUSTOM_HASH_SET KEY_GENERIC_TYPE set = new LINKED_CUSTOM_HASH_SETBRACES(0, loadFactor, strategy);
|
|
||||||
set.minCapacity = minCapacity;
|
|
||||||
set.mask = mask;
|
|
||||||
set.maxFill = maxFill;
|
|
||||||
set.nullIndex = nullIndex;
|
|
||||||
set.containsNull = containsNull;
|
|
||||||
set.size = size;
|
|
||||||
set.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
set.links = Arrays.copyOf(links, links.length);
|
|
||||||
set.firstIndex = firstIndex;
|
|
||||||
set.lastIndex = lastIndex;
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package speiger.src.collections.PACKAGE.sets;
|
|||||||
#if TYPE_OBJECT
|
#if TYPE_OBJECT
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
#endif
|
#endif
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
@ -581,22 +580,6 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
|||||||
return new SetIterator(fromElement);
|
return new SetIterator(fromElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LINKED_HASH_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
LINKED_HASH_SET KEY_GENERIC_TYPE set = new LINKED_HASH_SETBRACES(0, loadFactor);
|
|
||||||
set.minCapacity = minCapacity;
|
|
||||||
set.mask = mask;
|
|
||||||
set.maxFill = maxFill;
|
|
||||||
set.nullIndex = nullIndex;
|
|
||||||
set.containsNull = containsNull;
|
|
||||||
set.size = size;
|
|
||||||
set.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
set.links = Arrays.copyOf(links, links.length);
|
|
||||||
set.firstIndex = firstIndex;
|
|
||||||
set.lastIndex = lastIndex;
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
public COMPARATOR KEY_GENERIC_TYPE comparator() { return null; }
|
||||||
|
|
||||||
|
@ -115,8 +115,6 @@ public interface NAVIGABLE_SET KEY_GENERIC_TYPE extends NavigableSet<CLASS_TYPE>
|
|||||||
/** @return a Type Specific desendingSet */
|
/** @return a Type Specific desendingSet */
|
||||||
@Override
|
@Override
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE descendingSet();
|
public NAVIGABLE_SET KEY_GENERIC_TYPE descendingSet();
|
||||||
@Override
|
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Type Specific Type Splititerator to reduce boxing/unboxing
|
* A Type Specific Type Splititerator to reduce boxing/unboxing
|
||||||
|
@ -445,19 +445,6 @@ public class CUSTOM_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_T
|
|||||||
return new SetIterator();
|
return new SetIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public CUSTOM_HASH_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
CUSTOM_HASH_SET KEY_GENERIC_TYPE set = new CUSTOM_HASH_SETBRACES(0, loadFactor, strategy);
|
|
||||||
set.minCapacity = minCapacity;
|
|
||||||
set.mask = mask;
|
|
||||||
set.maxFill = maxFill;
|
|
||||||
set.nullIndex = nullIndex;
|
|
||||||
set.containsNull = containsNull;
|
|
||||||
set.size = size;
|
|
||||||
set.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
if(size == 0) return;
|
if(size == 0) return;
|
||||||
|
@ -477,19 +477,6 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
|
|||||||
return new SetIterator();
|
return new SetIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HASH_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
HASH_SET KEY_GENERIC_TYPE set = new HASH_SETBRACES(0, loadFactor);
|
|
||||||
set.minCapacity = minCapacity;
|
|
||||||
set.mask = mask;
|
|
||||||
set.maxFill = maxFill;
|
|
||||||
set.nullIndex = nullIndex;
|
|
||||||
set.containsNull = containsNull;
|
|
||||||
set.size = size;
|
|
||||||
set.keys = Arrays.copyOf(keys, keys.length);
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
if(size == 0) return;
|
if(size == 0) return;
|
||||||
|
@ -540,21 +540,6 @@ public class RB_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
|||||||
tree = null;
|
tree = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RB_TREE_SET KEY_GENERIC_TYPE copy() {
|
|
||||||
RB_TREE_SET KEY_GENERIC_TYPE set = new RB_TREE_SETBRACES();
|
|
||||||
set.size = size;
|
|
||||||
if(tree != null) {
|
|
||||||
set.tree = tree.copy();
|
|
||||||
Entry KEY_GENERIC_TYPE lastFound = null;
|
|
||||||
for(Entry KEY_GENERIC_TYPE entry = tree;entry != null;entry = entry.left) lastFound = entry;
|
|
||||||
set.first = lastFound;
|
|
||||||
lastFound = null;
|
|
||||||
for(Entry KEY_GENERIC_TYPE entry = tree;entry != null;entry = entry.right) lastFound = entry;
|
|
||||||
set.last = lastFound;
|
|
||||||
}
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator() { return comparator; }
|
public COMPARATOR KEY_GENERIC_TYPE comparator() { return comparator; }
|
||||||
|
|
||||||
@ -1085,9 +1070,6 @@ public class RB_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
|||||||
return fromStart && toEnd ? set.size() : iterator().skip(Integer.MAX_VALUE);
|
return fromStart && toEnd ? set.size() : iterator().skip(Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubSet KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
|
||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
@ -1332,22 +1314,6 @@ public class RB_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry KEY_GENERIC_TYPE copy() {
|
|
||||||
Entry KEY_GENERIC_TYPE entry = new EntryBRACES(key, null);
|
|
||||||
entry.state = state;
|
|
||||||
if(left != null) {
|
|
||||||
Entry KEY_GENERIC_TYPE newLeft = left.copy();
|
|
||||||
entry.left = newLeft;
|
|
||||||
newLeft.parent = entry;
|
|
||||||
}
|
|
||||||
if(right != null) {
|
|
||||||
Entry KEY_GENERIC_TYPE newRight = right.copy();
|
|
||||||
entry.right = newRight;
|
|
||||||
newRight.parent = entry;
|
|
||||||
}
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isBlack() {
|
boolean isBlack() {
|
||||||
return (state & BLACK) != 0;
|
return (state & BLACK) != 0;
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,6 @@ public interface SET KEY_GENERIC_TYPE extends Set<CLASS_TYPE>, COLLECTION KEY_GE
|
|||||||
@Override
|
@Override
|
||||||
public ITERATOR KEY_GENERIC_TYPE iterator();
|
public ITERATOR KEY_GENERIC_TYPE iterator();
|
||||||
|
|
||||||
@Override
|
|
||||||
public SET KEY_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
/**
|
/**
|
||||||
* A Type Specific remove function to reduce boxing/unboxing
|
* A Type Specific remove function to reduce boxing/unboxing
|
||||||
|
@ -60,9 +60,6 @@ public interface SORTED_SET KEY_GENERIC_TYPE extends SET KEY_GENERIC_TYPE, Sorte
|
|||||||
@Override
|
@Override
|
||||||
public COMPARATOR KEY_GENERIC_TYPE comparator();
|
public COMPARATOR KEY_GENERIC_TYPE comparator();
|
||||||
|
|
||||||
@Override
|
|
||||||
public SORTED_SET KEY_GENERIC_TYPE copy();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BI_ITERATOR KEY_GENERIC_TYPE iterator();
|
public BI_ITERATOR KEY_GENERIC_TYPE iterator();
|
||||||
/**
|
/**
|
||||||
|
@ -128,9 +128,6 @@ public class COLLECTIONS
|
|||||||
return c.iterator();
|
return c.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public COLLECTION KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Primitive
|
@Primitive
|
||||||
public boolean remove(Object o) { synchronized(mutex) { return c.remove(o); } }
|
public boolean remove(Object o) { synchronized(mutex) { return c.remove(o); } }
|
||||||
@ -225,8 +222,6 @@ public class COLLECTIONS
|
|||||||
@Override
|
@Override
|
||||||
public ITERATOR KEY_GENERIC_TYPE iterator() { return ITERATORS.unmodifiable(c.iterator()); }
|
public ITERATOR KEY_GENERIC_TYPE iterator() { return ITERATORS.unmodifiable(c.iterator()); }
|
||||||
@Override
|
@Override
|
||||||
public COLLECTION KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean remove(Object o) { throw new UnsupportedOperationException(); }
|
public boolean remove(Object o) { throw new UnsupportedOperationException(); }
|
||||||
@Override
|
@Override
|
||||||
@ -363,7 +358,5 @@ public class COLLECTIONS
|
|||||||
public void clear() {}
|
public void clear() {}
|
||||||
@Override
|
@Override
|
||||||
public int size() { return 0; }
|
public int size() { return 0; }
|
||||||
@Override
|
|
||||||
public EmptyCollection KEY_GENERIC_TYPE copy() { return this; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -216,9 +216,6 @@ public class LISTS
|
|||||||
#endif
|
#endif
|
||||||
@Override
|
@Override
|
||||||
public int size() { return 1; }
|
public int size() { return 1; }
|
||||||
|
|
||||||
@Override
|
|
||||||
public SingletonList KEY_GENERIC_TYPE copy() { return new SingletonListBRACES(element); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class SynchronizedArrayList KEY_GENERIC_TYPE extends SynchronizedList KEY_GENERIC_TYPE implements IARRAY KEY_GENERIC_TYPE
|
private static class SynchronizedArrayList KEY_GENERIC_TYPE extends SynchronizedList KEY_GENERIC_TYPE implements IARRAY KEY_GENERIC_TYPE
|
||||||
@ -375,9 +372,6 @@ public class LISTS
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void size(int size) { synchronized(mutex) { l.size(size); } }
|
public void size(int size) { synchronized(mutex) { l.size(size); } }
|
||||||
|
|
||||||
@Override
|
|
||||||
public LIST KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class UnmodifiableRandomList KEY_GENERIC_TYPE extends UnmodifiableList KEY_GENERIC_TYPE implements RandomAccess
|
private static class UnmodifiableRandomList KEY_GENERIC_TYPE extends UnmodifiableList KEY_GENERIC_TYPE implements RandomAccess
|
||||||
@ -487,9 +481,6 @@ public class LISTS
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void size(int size) { throw new UnsupportedOperationException(); }
|
public void size(int size) { throw new UnsupportedOperationException(); }
|
||||||
|
|
||||||
@Override
|
|
||||||
public LIST KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class EmptyList KEY_GENERIC_TYPE extends COLLECTIONS.EmptyCollection KEY_GENERIC_TYPE implements LIST KEY_GENERIC_TYPE
|
private static class EmptyList KEY_GENERIC_TYPE extends COLLECTIONS.EmptyCollection KEY_GENERIC_TYPE implements LIST KEY_GENERIC_TYPE
|
||||||
@ -572,8 +563,5 @@ public class LISTS
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void size(int size) { throw new UnsupportedOperationException(); }
|
public void size(int size) { throw new UnsupportedOperationException(); }
|
||||||
|
|
||||||
@Override
|
|
||||||
public EmptyList KEY_GENERIC_TYPE copy() { return this; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,8 +100,6 @@ public class PRIORITY_QUEUES
|
|||||||
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() { synchronized(mutex) { return queue.comparator(); } }
|
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() { synchronized(mutex) { return queue.comparator(); } }
|
||||||
@Override
|
@Override
|
||||||
public GENERIC_SPECIAL_KEY_BRACES<E> KEY_SPECIAL_TYPE[] TO_ARRAY(KEY_SPECIAL_TYPE[] input) { synchronized(mutex) { return queue.TO_ARRAY(input); } }
|
public GENERIC_SPECIAL_KEY_BRACES<E> KEY_SPECIAL_TYPE[] TO_ARRAY(KEY_SPECIAL_TYPE[] input) { synchronized(mutex) { return queue.TO_ARRAY(input); } }
|
||||||
@Override
|
|
||||||
public PRIORITY_QUEUE KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,7 +123,5 @@ public class PRIORITY_QUEUES
|
|||||||
public void enqueueFirst(KEY_TYPE e) { synchronized(mutex) { dequeue.enqueueFirst(e); } }
|
public void enqueueFirst(KEY_TYPE e) { synchronized(mutex) { dequeue.enqueueFirst(e); } }
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE dequeueLast() { synchronized(mutex) { return dequeue.dequeueLast(); } }
|
public KEY_TYPE dequeueLast() { synchronized(mutex) { return dequeue.dequeueLast(); } }
|
||||||
@Override
|
|
||||||
public PRIORITY_DEQUEUE KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,9 +190,6 @@ public class SETS
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int size() { return 1; }
|
public int size() { return 1; }
|
||||||
|
|
||||||
@Override
|
|
||||||
public SingletonSet KEY_GENERIC_TYPE copy() { return new SingletonSetBRACES(element); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class EmptySet KEY_GENERIC_TYPE extends EmptyCollection KEY_GENERIC_TYPE implements SET KEY_GENERIC_TYPE
|
private static class EmptySet KEY_GENERIC_TYPE extends EmptyCollection KEY_GENERIC_TYPE implements SET KEY_GENERIC_TYPE
|
||||||
@ -201,8 +198,6 @@ public class SETS
|
|||||||
@Override
|
@Override
|
||||||
public boolean remove(KEY_TYPE o) { throw new UnsupportedOperationException(); }
|
public boolean remove(KEY_TYPE o) { throw new UnsupportedOperationException(); }
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public EmptySet KEY_GENERIC_TYPE copy() { return this; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !TYPE_BOOLEAN
|
#if !TYPE_BOOLEAN
|
||||||
@ -250,9 +245,6 @@ public class SETS
|
|||||||
public KEY_TYPE getDefaultMinValue() { return n.getDefaultMinValue(); }
|
public KEY_TYPE getDefaultMinValue() { return n.getDefaultMinValue(); }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) { return unmodifiable(n.subSet(fromElement, fromInclusive, toElement, toInclusive)); }
|
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) { return unmodifiable(n.subSet(fromElement, fromInclusive, toElement, toInclusive)); }
|
||||||
|
|
||||||
@ -308,9 +300,6 @@ public class SETS
|
|||||||
@Override
|
@Override
|
||||||
public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement) { return ITERATORS.unmodifiable(s.iterator(fromElement)); }
|
public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement) { return ITERATORS.unmodifiable(s.iterator(fromElement)); }
|
||||||
|
|
||||||
@Override
|
|
||||||
public SORTED_SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SORTED_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, KEY_TYPE toElement) { return unmodifiable(s.subSet(fromElement, toElement)); }
|
public SORTED_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, KEY_TYPE toElement) { return unmodifiable(s.subSet(fromElement, toElement)); }
|
||||||
|
|
||||||
@ -347,9 +336,6 @@ public class SETS
|
|||||||
s = c;
|
s = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
@Override
|
@Override
|
||||||
public boolean remove(KEY_TYPE o) { throw new UnsupportedOperationException(); }
|
public boolean remove(KEY_TYPE o) { throw new UnsupportedOperationException(); }
|
||||||
@ -426,9 +412,6 @@ public class SETS
|
|||||||
public KEY_TYPE getDefaultMinValue() { synchronized(mutex) { return n.getDefaultMinValue(); } }
|
public KEY_TYPE getDefaultMinValue() { synchronized(mutex) { return n.getDefaultMinValue(); } }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) { synchronized(mutex) { return synchronize(n.subSet(fromElement, fromInclusive, toElement, toInclusive), mutex); } }
|
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) { synchronized(mutex) { return synchronize(n.subSet(fromElement, fromInclusive, toElement, toInclusive), mutex); } }
|
||||||
|
|
||||||
@ -509,10 +492,7 @@ public class SETS
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement) { synchronized(mutex) { return s.iterator(fromElement); } }
|
public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement) { synchronized(mutex) { return s.iterator(fromElement); } }
|
||||||
|
|
||||||
@Override
|
|
||||||
public SORTED_SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SORTED_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, KEY_TYPE toElement) { synchronized(mutex) { return synchronize(s.subSet(fromElement, toElement), mutex); } }
|
public SORTED_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, KEY_TYPE toElement) { synchronized(mutex) { return synchronize(s.subSet(fromElement, toElement), mutex); } }
|
||||||
|
|
||||||
@ -576,9 +556,6 @@ public class SETS
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
@Override
|
@Override
|
||||||
public boolean remove(KEY_TYPE o) { synchronized(mutex) { return s.remove(o); } }
|
public boolean remove(KEY_TYPE o) { synchronized(mutex) { return s.remove(o); } }
|
||||||
|
@ -277,8 +277,6 @@ public class MAPS
|
|||||||
@Override
|
@Override
|
||||||
public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { return EQUALS_KEY_TYPE(key, this.key) ? value : defaultValue; }
|
public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { return EQUALS_KEY_TYPE(key, this.key) ? value : defaultValue; }
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public SingletonMap KEY_VALUE_GENERIC_TYPE copy() { return new SingletonMapKV_BRACES(key, value); }
|
|
||||||
@Override
|
@Override
|
||||||
public SET KEY_GENERIC_TYPE keySet() {
|
public SET KEY_GENERIC_TYPE keySet() {
|
||||||
if(keySet == null) keySet = SETS.singleton(key);
|
if(keySet == null) keySet = SETS.singleton(key);
|
||||||
@ -331,8 +329,6 @@ public class MAPS
|
|||||||
public VALUE_COLLECTION VALUE_GENERIC_TYPE values() { return VALUE_COLLECTIONS.empty(); }
|
public VALUE_COLLECTION VALUE_GENERIC_TYPE values() { return VALUE_COLLECTIONS.empty(); }
|
||||||
@Override
|
@Override
|
||||||
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() { return ObjectSets.empty(); }
|
public ObjectSet<MAP.Entry KEY_VALUE_GENERIC_TYPE> ENTRY_SET() { return ObjectSets.empty(); }
|
||||||
@Override
|
|
||||||
public EmptyMap KEY_VALUE_GENERIC_TYPE copy() { return this; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -419,8 +415,6 @@ public class MAPS
|
|||||||
public MAP.Entry KEY_VALUE_GENERIC_TYPE floorEntry(KEY_TYPE key) { return unmodifiable(map.floorEntry(key)); }
|
public MAP.Entry KEY_VALUE_GENERIC_TYPE floorEntry(KEY_TYPE key) { return unmodifiable(map.floorEntry(key)); }
|
||||||
@Override
|
@Override
|
||||||
public MAP.Entry KEY_VALUE_GENERIC_TYPE ceilingEntry(KEY_TYPE key) { return unmodifiable(map.ceilingEntry(key)); }
|
public MAP.Entry KEY_VALUE_GENERIC_TYPE ceilingEntry(KEY_TYPE key) { return unmodifiable(map.ceilingEntry(key)); }
|
||||||
@Override
|
|
||||||
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -468,8 +462,6 @@ public class MAPS
|
|||||||
public VALUE_TYPE FIRST_ENTRY_VALUE() { return map.FIRST_ENTRY_VALUE(); }
|
public VALUE_TYPE FIRST_ENTRY_VALUE() { return map.FIRST_ENTRY_VALUE(); }
|
||||||
@Override
|
@Override
|
||||||
public VALUE_TYPE LAST_ENTRY_VALUE() { return map.LAST_ENTRY_VALUE(); }
|
public VALUE_TYPE LAST_ENTRY_VALUE() { return map.LAST_ENTRY_VALUE(); }
|
||||||
@Override
|
|
||||||
public SORTED_MAP KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -509,8 +501,6 @@ public class MAPS
|
|||||||
@Override
|
@Override
|
||||||
public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { return map.getOrDefault(key, defaultValue); }
|
public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { return map.getOrDefault(key, defaultValue); }
|
||||||
#endif
|
#endif
|
||||||
@Override
|
|
||||||
public MAP KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SET KEY_GENERIC_TYPE keySet() {
|
public SET KEY_GENERIC_TYPE keySet() {
|
||||||
@ -624,9 +614,7 @@ public class MAPS
|
|||||||
public MAP.Entry KEY_VALUE_GENERIC_TYPE floorEntry(KEY_TYPE key) { synchronized(mutex) { return map.floorEntry(key); } }
|
public MAP.Entry KEY_VALUE_GENERIC_TYPE floorEntry(KEY_TYPE key) { synchronized(mutex) { return map.floorEntry(key); } }
|
||||||
@Override
|
@Override
|
||||||
public MAP.Entry KEY_VALUE_GENERIC_TYPE ceilingEntry(KEY_TYPE key) { synchronized(mutex) { return map.ceilingEntry(key); } }
|
public MAP.Entry KEY_VALUE_GENERIC_TYPE ceilingEntry(KEY_TYPE key) { synchronized(mutex) { return map.ceilingEntry(key); } }
|
||||||
@Override
|
#if !TYPE_OBJECT
|
||||||
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
#if !TYPE_OBJECT
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE subMap(CLASS_TYPE fromKey, boolean fromInclusive, CLASS_TYPE toKey, boolean toInclusive) { synchronized(mutex) { return synchronize(map.subMap(fromKey, fromInclusive, toKey, toInclusive), mutex); } }
|
public NAVIGABLE_MAP KEY_VALUE_GENERIC_TYPE subMap(CLASS_TYPE fromKey, boolean fromInclusive, CLASS_TYPE toKey, boolean toInclusive) { synchronized(mutex) { return synchronize(map.subMap(fromKey, fromInclusive, toKey, toInclusive), mutex); } }
|
||||||
@ -730,8 +718,6 @@ public class MAPS
|
|||||||
public VALUE_TYPE FIRST_ENTRY_VALUE() { synchronized(mutex) { return map.FIRST_ENTRY_VALUE(); } }
|
public VALUE_TYPE FIRST_ENTRY_VALUE() { synchronized(mutex) { return map.FIRST_ENTRY_VALUE(); } }
|
||||||
@Override
|
@Override
|
||||||
public VALUE_TYPE LAST_ENTRY_VALUE() { synchronized(mutex) { return map.LAST_ENTRY_VALUE(); } }
|
public VALUE_TYPE LAST_ENTRY_VALUE() { synchronized(mutex) { return map.LAST_ENTRY_VALUE(); } }
|
||||||
@Override
|
|
||||||
public SORTED_MAP KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
#if !TYPE_OBJECT
|
#if !TYPE_OBJECT
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -845,8 +831,6 @@ public class MAPS
|
|||||||
@Override
|
@Override
|
||||||
public int size() { synchronized(mutex) { return super.size(); } }
|
public int size() { synchronized(mutex) { return super.size(); } }
|
||||||
@Override
|
@Override
|
||||||
public MAP KEY_VALUE_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); }
|
|
||||||
@Override
|
|
||||||
public SET KEY_GENERIC_TYPE keySet() {
|
public SET KEY_GENERIC_TYPE keySet() {
|
||||||
if(keys == null) keys = SETS.synchronize(map.keySet(), mutex);
|
if(keys == null) keys = SETS.synchronize(map.keySet(), mutex);
|
||||||
return keys;
|
return keys;
|
||||||
|
@ -135,16 +135,6 @@ public abstract class BaseInt2IntMapTest
|
|||||||
Assert.assertTrue(map.remove(PUT_VALUE_ARRAY[51], PUT_ARRAY[51]));
|
Assert.assertTrue(map.remove(PUT_VALUE_ARRAY[51], PUT_ARRAY[51]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSort()
|
|
||||||
{
|
|
||||||
if(!getValidMapTests().contains(MapTests.COPY)) return;
|
|
||||||
Int2IntMap map = createMap(TEST_ARRAY, TEST_ARRAY);
|
|
||||||
Int2IntMap copy = map.copy();
|
|
||||||
Assert.assertFalse(map == copy);
|
|
||||||
Assert.assertEquals(map, copy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Strategy implements IntStrategy
|
public static class Strategy implements IntStrategy
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -178,13 +178,4 @@ public abstract class BaseIntCollectionTest extends BaseIntIterableTest
|
|||||||
Assert.assertEquals(base, IntCollections.synchronize(collection).toString());
|
Assert.assertEquals(base, IntCollections.synchronize(collection).toString());
|
||||||
Assert.assertEquals(base, IntCollections.unmodifiable(collection).toString());
|
Assert.assertEquals(base, IntCollections.unmodifiable(collection).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCopy() {
|
|
||||||
if(!getValidCollectionTests().contains(CollectionTest.COPY)) return;
|
|
||||||
IntCollection collection = create(BULK_ADD_ARRAY);
|
|
||||||
IntCollection copy = collection.copy();
|
|
||||||
Assert.assertFalse(collection == copy);
|
|
||||||
Assert.assertEquals(collection, copy);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -120,13 +120,4 @@ public abstract class BaseIntPriorityQueueTest extends BaseIntIterableTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCopy() {
|
|
||||||
if(!getValidPriorityQueueTests().contains(PriorityQueueTest.COPY)) return;
|
|
||||||
IntPriorityQueue queue = create(TEST_ARRAY);
|
|
||||||
IntPriorityQueue copy = queue.copy();
|
|
||||||
Assert.assertFalse(queue == copy);
|
|
||||||
Assert.assertEquals(queue, copy);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,5 @@ public enum CollectionTest
|
|||||||
TO_ARRAY,
|
TO_ARRAY,
|
||||||
CLEAR,
|
CLEAR,
|
||||||
WRAPPER,
|
WRAPPER,
|
||||||
TO_STRING,
|
TO_STRING;
|
||||||
COPY;
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,5 @@ public enum MapTests
|
|||||||
MERGE,
|
MERGE,
|
||||||
GET,
|
GET,
|
||||||
ITERATORS,
|
ITERATORS,
|
||||||
REMOVE,
|
REMOVE;
|
||||||
COPY;
|
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,4 @@ public enum PriorityQueueTest
|
|||||||
PEEK,
|
PEEK,
|
||||||
REMOVE,
|
REMOVE,
|
||||||
TO_ARRAY,
|
TO_ARRAY,
|
||||||
COPY;
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user