package com.beanit.asn1dsrc.util;

public class DsrcAsn1Sequence {
    private Integer seq = Integer.valueOf(1);

    public DsrcAsn1Sequence() {
        this.seq = Integer.valueOf(1);
    }

    public DsrcAsn1Sequence(int num) {
        this.seq = Integer.valueOf(num);
    }

    public int nextValue() {
        synchronized (this.seq) {
            if (this.seq.intValue() == Integer.MAX_VALUE) {
                this.seq = Integer.valueOf(1);
            } else {
                this.seq = Integer.valueOf(this.seq.intValue() + 1);
            }
        }
        return this.seq.intValue();
    }

    public int currentValue() {
        return this.seq.intValue();
    }

    //public void resetValue(int num) {
    //    this.seq = Integer.valueOf(num);
    //}
    public void resetValue() {
        this.seq = Integer.valueOf(1);
    }
}
