Skip to content
  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in

谢明辉 / recv_data_longhua

Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • recv_data_longhua
  • ..
  • utils
  • IntUtils.java
  • xmh's avatar
    第二阶段完成 · 360652c3
    xmh committed Sep 07, 2020
    360652c3 Browse Files
IntUtils.java 452 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package com.viontech.utils;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * .
 *
 * @author 谢明辉
 * @date 2020/8/26
 */

public class IntUtils {
    private static final AtomicInteger atomicInteger = new AtomicInteger();


    public static synchronized Integer next() {
        int num = atomicInteger.getAndIncrement();
        if (num == Integer.MAX_VALUE) {
            atomicInteger.set(0);
        }
        return num;
    }


}