@SuppressWarnings("unchecked") public ArrayHashMap(int initialCapacity) { int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.keys = (K[]) new Object[capacity]; this.values = (V[]) new Object[capacity]; this.size = 0; }
@SuppressWarnings("unchecked") public ArrayHashMap(int initialCapacity) { int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.keys = (K[]) new Object[capacity]; this.values = (V[]) new Object[capacity]; this.size = 0; }
@SuppressWarnings("unchecked") public ArrayHashSet(int initialCapacity) { int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.data = (E[]) new Object[capacity]; this.size = 0; }
@SuppressWarnings("unchecked") public ArrayHashSet(int initialCapacity) { int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.data = (E[]) new Object[capacity]; this.size = 0; }
@SuppressWarnings("unchecked") public ArrayHashMap(int initialCapacity) { int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.keys = (K[]) new Object[capacity]; this.values = (V[]) new Object[capacity]; this.size = 0; }
@SuppressWarnings("unchecked") public ArrayHashSet(int initialCapacity) { int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.data = (E[]) new Object[capacity]; this.size = 0; }
@SuppressWarnings("unchecked") public ArraySlicedSet(int slices, int initialCapacity) { if (slices <= 0 || slices > MAX_SLICES) throw new IllegalArgumentException( "The nuber of slices should be between 1 and " + MAX_SLICES + ": " + slices); int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.data = (E[]) new Object[capacity]; this.logs = (byte) upperLog(slices); this.masks = new int[getMaskCapacity(logs, capacity)]; this.sizes = new int[slices]; initSizes(); }
@SuppressWarnings("unchecked") public ArraySlicedSet(int slices, int initialCapacity) { if (slices <= 0 || slices > MAX_SLICES) throw new IllegalArgumentException( "The nuber of slices should be between 1 and " + MAX_SLICES + ": " + slices); int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.data = (E[]) new Object[capacity]; this.logs = (byte) upperLog(slices); this.masks = new int[getMaskCapacity(logs, capacity)]; this.sizes = new int[slices]; initSizes(); }
@SuppressWarnings("unchecked") public ArraySlicedSet(int slices, int initialCapacity) { if (slices <= 0 || slices > MAX_SLICES) throw new IllegalArgumentException( "The nuber of slices should be between 1 and " + MAX_SLICES + ": " + slices); int capacity = LinearProbing.getInitialCapacity(initialCapacity); this.data = (E[]) new Object[capacity]; this.logs = (byte) upperLog(slices); this.masks = new int[getMaskCapacity(logs, capacity)]; this.sizes = new int[slices]; initSizes(); }