@Test public void testAddItems() { ConcurrentFloatArray a = new ConcurrentFloatArray(); CountDownLatch latch = new CountDownLatch(100); createStartAndJoinThreads(new Runnable() { @Override public void run() { latch.countDown(); try { latch.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } for (int i = 0; i < 100; i++) { a.add(i); } } }, 100); assertEquals(a.size, 10*1000); }
@Override public void add(float value) { lock.lockWrite(); super.add(value); lock.unlockWrite(); }
ConcurrentFloatArray extends FloatArray implements ConcurrentCollection { @Override public void add(float value) { lock.lockWrite(); super.add(value); lock.unlockWrite(); } }
ConcurrentFloatArray extends FloatArray implements ConcurrentCollection { @Override public void add(float value) { lock.lockWrite(); super.add(value); lock.unlockWrite(); } ConcurrentFloatArray();  ConcurrentFloatArray(int capacity);  ConcurrentFloatArray(boolean ordered, int capacity);  ConcurrentFloatArray(FloatArray array);  ConcurrentFloatArray(float[] array);  ConcurrentFloatArray(boolean ordered, float[] array, int startIndex, int count); }
ConcurrentFloatArray extends FloatArray implements ConcurrentCollection { @Override public void add(float value) { lock.lockWrite(); super.add(value); lock.unlockWrite(); } ConcurrentFloatArray();  ConcurrentFloatArray(int capacity);  ConcurrentFloatArray(boolean ordered, int capacity);  ConcurrentFloatArray(FloatArray array);  ConcurrentFloatArray(float[] array);  ConcurrentFloatArray(boolean ordered, float[] array, int startIndex, int count); @Override void add(float value); @Override void add(float value1, float value2); @Override void add(float value1, float value2, float value3); @Override void add(float value1, float value2, float value3, float value4); @Override void addAll(FloatArray array, int offset, int length); @Override void addAll(float[] array, int offset, int length); @Override float get(int index); @Override void set(int index, float value); @Override void incr(int index, float value); @Override void mul(int index, float value); @Override void insert(int index, float value); @Override void swap(int first, int second); @Override boolean contains(float value); @Override int indexOf(float value); @Override int lastIndexOf(char value); @Override boolean removeValue(float value); @Override float removeIndex(int index); @Override void removeRange(int start, int end); @Override boolean removeAll(FloatArray array); @Override float pop(); @Override float peek(); @Override float first(); @Override boolean notEmpty(); @Override boolean isEmpty(); @Override void clear(); @Override float[] shrink(); @Override float[] ensureCapacity(int additionalCapacity); @Override float[] setSize(int newSize); @Override void sort(); @Override void reverse(); @Override void shuffle(); @Override void truncate(int newSize); @Override float random(); @Override float[] toArray(); @Override int hashCode(); @Override boolean equals(Object object); @Override boolean equals(Object object, float epsilon); @Override String toString(); @Override String toString(String separator); @Override ReadWriteLock getLock(); }
ConcurrentFloatArray extends FloatArray implements ConcurrentCollection { @Override public void add(float value) { lock.lockWrite(); super.add(value); lock.unlockWrite(); } ConcurrentFloatArray();  ConcurrentFloatArray(int capacity);  ConcurrentFloatArray(boolean ordered, int capacity);  ConcurrentFloatArray(FloatArray array);  ConcurrentFloatArray(float[] array);  ConcurrentFloatArray(boolean ordered, float[] array, int startIndex, int count); @Override void add(float value); @Override void add(float value1, float value2); @Override void add(float value1, float value2, float value3); @Override void add(float value1, float value2, float value3, float value4); @Override void addAll(FloatArray array, int offset, int length); @Override void addAll(float[] array, int offset, int length); @Override float get(int index); @Override void set(int index, float value); @Override void incr(int index, float value); @Override void mul(int index, float value); @Override void insert(int index, float value); @Override void swap(int first, int second); @Override boolean contains(float value); @Override int indexOf(float value); @Override int lastIndexOf(char value); @Override boolean removeValue(float value); @Override float removeIndex(int index); @Override void removeRange(int start, int end); @Override boolean removeAll(FloatArray array); @Override float pop(); @Override float peek(); @Override float first(); @Override boolean notEmpty(); @Override boolean isEmpty(); @Override void clear(); @Override float[] shrink(); @Override float[] ensureCapacity(int additionalCapacity); @Override float[] setSize(int newSize); @Override void sort(); @Override void reverse(); @Override void shuffle(); @Override void truncate(int newSize); @Override float random(); @Override float[] toArray(); @Override int hashCode(); @Override boolean equals(Object object); @Override boolean equals(Object object, float epsilon); @Override String toString(); @Override String toString(String separator); @Override ReadWriteLock getLock();  }