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
Representation of a block of values.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe next id position.private static final longThe list of values in this block. -
Constructor Summary
ConstructorsConstructorDescriptionValueGenerationBlock(List<T> oid) Constructor.ValueGenerationBlock(T[] values) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlock(ValueGenerationBlock<T> block) Method to append a block onto this block.current()Accessor for the current value.booleanhasNext()Accessor for whether there are more values remaining in the block.next()Accessor for the next value, or null if block values exhaustedtoString()Stringify method.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
nextIndex
private int nextIndexThe next id position. -
valueList
-
-
Constructor Details
-
ValueGenerationBlock
Constructor.- Parameters:
values- The block of objects that will be considered the "values"
-
ValueGenerationBlock
-
-
Method Details
-
current
Accessor for the current value.- Returns:
- The current value
- Throws:
NoSuchElementException- Thrown if no current value
-
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
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
-
toString
-