Package com.solab.iso8583.impl
Class SimpleTraceGenerator
- java.lang.Object
-
- com.solab.iso8583.impl.SimpleTraceGenerator
-
- All Implemented Interfaces:
TraceNumberGenerator
public class SimpleTraceGenerator extends java.lang.Object implements TraceNumberGenerator
Simple implementation of a TraceNumberGenerator with an internal number that is increased in memory but is not stored anywhere.
-
-
Constructor Summary
Constructors Constructor Description SimpleTraceGenerator(int initialValue)
Creates a new instance that will use the specified initial value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLastTrace()
Returns the last number that was generated.int
nextTrace()
Returns the next number in the sequence.
-
-
-
Constructor Detail
-
SimpleTraceGenerator
public SimpleTraceGenerator(int initialValue)
Creates a new instance that will use the specified initial value. This means the first nextTrace() call will return this number.- Parameters:
initialValue
- a number between 1 and 999999.- Throws:
java.lang.IllegalArgumentException
- if the number is less than 1 or greater than 999999.
-
-
Method Detail
-
getLastTrace
public int getLastTrace()
Description copied from interface:TraceNumberGenerator
Returns the last number that was generated.- Specified by:
getLastTrace
in interfaceTraceNumberGenerator
-
nextTrace
public int nextTrace()
Returns the next number in the sequence. This method is synchronized, because the counter is incremented in memory only.- Specified by:
nextTrace
in interfaceTraceNumberGenerator
-
-