From f9f881e59c78e3036cb3f956bc97cfc3197f620d Mon Sep 17 00:00:00 2001
From: Sven Gothel
*
* User needs to synchronize above methods w/ the lock-free
* w/ {@link #get() get*(..)} and {@link #put(Object) put*(..)} methods,
@@ -99,10 +100,7 @@ public class LFRingbuffer
* Integer[] source = new Integer[10];
* // fill source with content ..
- * Ringbuffer
*
@@ -113,12 +111,12 @@ public class LFRingbuffercopyFrom
into the internal array.
*
copyFrom
is null
*/
- public LFRingbuffer(T[] copyFrom, AllocEmptyArray* Example for a 10 element Integer array: *
- * Ringbuffer* *rb = new LFRingbuffer (10, new Ringbuffer.AllocEmptyArray () { - * public Integer[] newArray(int size) { - * return new Integer[size]; - * } } ); + * Ringbuffer rb = new LFRingbuffer (10, Integer[].class); *
@@ -139,15 +134,15 @@ public class LFRingbuffer
* Implementation will allocate an internal array of size
* Growing an empty ring buffer increases it's size about the amount, i.e. renders it not empty.
* The new elements are inserted at the read position, able to be read out via {@link #get()} etc.
*
* Growing a full ring buffer leaves the size intact, i.e. renders it not full.
- * The new elements are inserted at the write position, able to be written to via {@link #put(Object)} etc.
+ * New capacity
plus one.
* null
elements are inserted at the write position, able to be written to via {@link #put(Object)} etc.
* null
.
- * If not null
, array size must be <= amount
* @param amount the amount of elements the buffer shall grow about
- * @param allocEmptyArray implementation hook to allocate a new empty array of generic type T
- * @throws IllegalStateException if buffer is neither full nor empty
- * @throws IllegalArgumentException if newElements is given but is > amount
+ *
+ * @throws IllegalStateException if buffer is not full
+ * @throws IllegalArgumentException if amount is < 0
*/
- public void growBuffer(T[] newElements, int amount,
- AllocEmptyArray
* Integer[] source = new Integer[10];
* // fill source with content ..
- * Ringbuffer
*
@@ -91,12 +89,12 @@ public class SyncedRingbuffercopyFrom
into the internal array.
*
copyFrom
is null
*/
- public SyncedRingbuffer(T[] copyFrom, AllocEmptyArray* Example for a 10 element Integer array: *
- * Ringbuffer* *rb = new SyncedRingbuffer (10, new Ringbuffer.AllocEmptyArray () { - * public Integer[] newArray(int size) { - * return new Integer[size]; - * } } ); + * Ringbuffer rb = new SyncedRingbuffer (10, Integer[].class); *
@@ -117,13 +112,13 @@ public class SyncedRingbuffer
* Implementation will allocate an internal array of size capacity
.
*