Java AtomicInteger getReply()

Here you can find the source of getReply()

Description

get Reply

License

Open Source License

Declaration

private static int getReply() 

Method Source Code


//package com.java2s;

import java.util.concurrent.atomic.AtomicInteger;

public class Main {
    private static AtomicInteger replyNO = new AtomicInteger(0);

    private static int getReply() {
        if (replyNO.get() < 10000000) {
            return replyNO.getAndIncrement();
        } else {// ww w  .j  av  a  2 s  .co m
            replyNO.set(0);
            return replyNO.getAndIncrement();
        }

    }
}

Related

  1. getPrefix(final String namespace, final Map namespacesPrefixesMap)
  2. getPrefixedTerm(String namespace, String localName)
  3. getQueryCounters()
  4. getRandom()
  5. getRandomTenantId()
  6. getSerialNum()
  7. getTempFileName()
  8. getThreadDumpId()
  9. getThreadName(String pattern, String name)