package com.its.vms.domain;

public class VmsFrameSequence {
    private Short seq = 1;

    public VmsFrameSequence() {
        this.seq = 1;
    }

    public VmsFrameSequence(short num) {
        this.seq = num;
    }

    public short nextValue() {
        synchronized (this.seq) {
            if (this.seq == Short.MAX_VALUE) {
                this.seq = 1;
            } else {
                this.seq = (short) (this.seq + 1);
            }
        }
        return this.seq;
    }

    public short currentValue() {
        return this.seq;
    }

    public void resetValue() {
        this.seq = 1;
    }
}
