Class ValueGenerationBlock<T>
- java.lang.Object
-
- org.datanucleus.store.valuegenerator.ValueGenerationBlock<T>
-
- Type Parameters:
T- Type of the value (String, Long etc)
- All Implemented Interfaces:
Serializable
public class ValueGenerationBlock<T> extends Object implements Serializable
Representation of a block of values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValueGenerationBlock(List<T> oid)Constructor.ValueGenerationBlock(T[] values)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBlock(ValueGenerationBlock<T> block)Method to append a block onto this block.Tcurrent()Accessor for the current value.booleanhasNext()Accessor for whether there are more values remaining in the block.Tnext()Accessor for the next value, or null if block values exhaustedStringtoString()Stringify method.
-
-
-
Constructor Detail
-
ValueGenerationBlock
public ValueGenerationBlock(T[] values)
Constructor.- Parameters:
values- The block of objects that will be considered the "values"
-
-
Method Detail
-
current
public T current()
Accessor for the current value.- Returns:
- The current value
- Throws:
NoSuchElementException- Thrown if no current value
-
next
public T next()
Accessor for the next value, or null if block values exhausted- Returns:
- The next value
-
hasNext
public boolean hasNext()
Accessor for whether there are more values remaining in the block.- Returns:
- True when has more values
-
addBlock
public void addBlock(ValueGenerationBlock<T> block)
Method to append a block onto this block. This is used where we have some values left, and we want to allocate more to go into this block.- Parameters:
block- The other block
-
-