Package ca.uhn.hl7v2.util.idgenerator
Class DelegatingHiLoGenerator
java.lang.Object
ca.uhn.hl7v2.util.idgenerator.IDGenerator.OrderedSupport
ca.uhn.hl7v2.util.idgenerator.HiLoGenerator
ca.uhn.hl7v2.util.idgenerator.DelegatingHiLoGenerator
- All Implemented Interfaces:
IDGenerator,IDGenerator.Ordered
- Direct Known Subclasses:
FileBasedHiLoGenerator
Default implementation of a HiLo ID generator that allows to use another
(non-HiLo) ID generator for generating the "hi" part of the ID. The delegate
must increment its ID is discrete steps > 1, so that the gaps can be filled
with "lo" IDs.
Example:
Hi IDs: 0, 100, 200, 300 (increment = 100)
Lo IDs: 1,2,3,...,100,1,2,3,....
Resulting ID (Hi + Lo): 1,2,3,99,100,101,102,...
- Author:
- Christian Ohr
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ca.uhn.hl7v2.util.idgenerator.IDGenerator
IDGenerator.Ordered, IDGenerator.OrderedSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetMaxLo()THe maximum "lo" ID is the increment of the hi ID.protected longReturns the next Hi IDprotected voidResets the Hi IDvoidsetDelegate(IDGenerator.Ordered delegate) Methods inherited from class ca.uhn.hl7v2.util.idgenerator.HiLoGenerator
getID, getNextLoId, resetMethods inherited from class ca.uhn.hl7v2.util.idgenerator.IDGenerator.OrderedSupport
getIncrement
-
Constructor Details
-
DelegatingHiLoGenerator
public DelegatingHiLoGenerator() -
DelegatingHiLoGenerator
-
-
Method Details
-
getNextHiId
Description copied from class:HiLoGeneratorReturns the next Hi ID- Specified by:
getNextHiIdin classHiLoGenerator- Returns:
- the next Hi ID
- Throws:
IOException
-
setDelegate
-
resetHiId
Description copied from class:HiLoGeneratorResets the Hi ID- Specified by:
resetHiIdin classHiLoGenerator
-
getMaxLo
THe maximum "lo" ID is the increment of the hi ID.- Specified by:
getMaxLoin classHiLoGenerator- Returns:
-