org.datanucleus.store.valuegenerator
Class TimestampValueGenerator

java.lang.Object
  extended by org.datanucleus.store.valuegenerator.AbstractGenerator
      extended by org.datanucleus.store.valuegenerator.TimestampValueGenerator
All Implemented Interfaces:
ValueGenerator

public class TimestampValueGenerator
extends AbstractGenerator

Value generator for timestamp values (millisecs). The "timestamps" are the number of milliseconds (since Jan 1 1970).


Field Summary
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, LOCALISER, name, properties, repositoryExists
 
Constructor Summary
TimestampValueGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected  ValueGenerationBlock reserveBlock(long size)
          Method to reserve a block of values.
 
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocate, createRepository, current, currentValue, getName, getStorageClass, next, nextValue, obtainGenerationBlock, obtainGenerationBlock, repositoryExists, requiresRepository, reserveBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimestampValueGenerator

public TimestampValueGenerator(java.lang.String name,
                               java.util.Properties props)
Constructor.

Parameters:
name - Symbolic name of the generator
props - Any properties controlling its behaviour.
Method Detail

reserveBlock

protected ValueGenerationBlock reserveBlock(long size)
Method to reserve a block of values. Only ever reserves a single timestamp, to the time at which it is created.

Specified by:
reserveBlock in class AbstractGenerator
Parameters:
size - Number of elements to reserve.
Returns:
The block.


Copyright © 2011. All Rights Reserved.