/** * Clears all slices of this {@link ArraySlicedSet}. After calling this * methods, all slices are empty. */ @SuppressWarnings("unchecked") public void clear() { int capacity = data.length >> 2; if (capacity == 0) capacity = 1; initSizes(); this.data = (E[]) new Object[capacity]; this.masks = new int[getMaskCapacity(logs, capacity)]; }
/** * Clears all slices of this {@link ArraySlicedSet}. After calling this * methods, all slices are empty. */ @SuppressWarnings("unchecked") public void clear() { int capacity = data.length >> 2; if (capacity == 0) capacity = 1; initSizes(); this.data = (E[]) new Object[capacity]; this.masks = new int[getMaskCapacity(logs, capacity)]; }
/** * Clears all slices of this {@link ArraySlicedSet}. After calling this * methods, all slices are empty. */ @SuppressWarnings("unchecked") public void clear() { int capacity = data.length >> 2; if (capacity == 0) capacity = 1; initSizes(); this.data = (E[]) new Object[capacity]; this.masks = new int[getMaskCapacity(logs, capacity)]; }
@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(); }