Java AtomicLong createAtomicId()

Here you can find the source of createAtomicId()

Description

create Atomic Id

License

Apache License

Declaration

private static AtomicLong createAtomicId() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;

public class Main {
    private static AtomicLong createAtomicId() {
        int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000;
        return new AtomicLong((long) baseId);
    }/* w  w w  .  jav  a2s .co  m*/
}

Related

  1. add(AtomicLongFieldUpdater updater, T instance, long n)
  2. addAndGet(AtomicLong current, long toAdd)
  3. addstat(Map stat, String key)
  4. average(Stream stream)
  5. compareAndSetIfGreater(final AtomicLong dest, final long tryValue)
  6. createId(final Long baseId)
  7. createObjectID()
  8. createUniqueFileName(String out)
  9. currentDate()