Module org.refcodes.generator
Package org.refcodes.generator
A generator is a value provider providing one value after the other without
further parameters required. The generator may be initialized beforehand.
After initialization, the
Generator.next()
method will get the next generated value. As the
Generator
is a generic type, you may implement
generators for many different types. An
IdGenerator
for example creates unique
String
values (unique in the scope of your infrastructure
given that you do not run the same application on the same machine more than
one).-
Interface Summary Interface Description Generator<T> AGenerator
generates objects of a dedicated type in mass production.IdGenerator TheIdGenerator
interface defines generator functionality forString
instances.SeriesMonitor<T> TheSeriesMonitor
is aGenerator
with means to monitor the last fully processed (completed) ID of the series of generated IDs with all preceding generated IDs also being fully processed (completed): All IDs till the last fully processed (completed) ID have been processed. -
Class Summary Class Description AlphabetCounter TheAlphabetCounter
generates values by counting with an an alphabet of "digits", a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9", a hexadecimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F".SeriesMonitorDecorator<T> TheSeriesMonitorDecorator
decorates aGenerator
with means to monitor the last fully processed (completed) ID of the series of generated IDs with all preceding generated IDs also being fully processed (completed): All IDs till the last fully processed (completed) ID have been processed.ThreadBufferedGeneratorDecorator<T> TheThreadBufferedGeneratorDecorator
decorates aGenerator
with read-ahead functionality by buffering generated IDs on a perThread
basis: The resultingGenerator
is thread safe!UniqueIdGenerator TheUniqueIdGenerator
is an implementation of theGenerator
capable of generating TIDString
instances unique on the system on which them were generated to IDs generated with the sameUniqueIdGenerator
on another system.UniqueIdGeneratorSingleton The Class UniqueIdGeneratorSingleton.