Class UnsynchronizedSequence

  • All Implemented Interfaces:
    Sequence

    public class UnsynchronizedSequence
    extends Object
    implements Sequence
    Generates incrementing identifiers in a thread-unsafe manner using a simple primitive without any synchronization.
    Author:
    AO Industries, Inc.
    • Constructor Detail

      • UnsynchronizedSequence

        public UnsynchronizedSequence()
        Starts at the value of 1.
      • UnsynchronizedSequence

        public UnsynchronizedSequence​(long initialValue)
    • Method Detail

      • getNextSequenceValue

        public long getNextSequenceValue()
        Description copied from interface: Sequence
        Gets the next value from the sequence.
        Specified by:
        getNextSequenceValue in interface Sequence