Java Utililty Methods AtomicInteger

List of utility methods to do AtomicInteger

Description

The list of methods to do AtomicInteger are organized into topic(s).

Method

StringgetThreadName(String pattern, String name)
Creates a new thread name with the given prefix
if (pattern == null) {
    pattern = DEFAULT_PATTERN;
if (name.indexOf("$") > -1) {
    name = name.replaceAll("\\$", "CAMEL_REPLACE_ME");
String longName = name;
String shortName = name.contains("?") ? before(name, "?") : name;
...
UUIDgetTimeBasedUUID()
Generates Type 1 UUID.
long time = ((System.currentTimeMillis() * HUNDRED_NANOS_PER_MILLI) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH)
        + (count.incrementAndGet() % HUNDRED_NANOS_PER_MILLI);
long timeLow = (time & LOW_MASK) << SHIFT_4;
long timeMid = (time & MID_MASK) >> SHIFT_2;
long timeHi = (time & HIGH_MASK) >> SHIFT_6;
long most = timeLow | timeMid | TYPE1 | timeHi;
return new UUID(most, least);
intgetUniqueId()
get Unique Id
return ID_GENERATOR.getAndIncrement();
StringgetUuidAsFourCharacterGroups()
get Uuid As Four Character Groups
UUID uuid = getTimeBasedUUID();
String uuid_s = uuid.toString();
String[] parts = uuid_s.split("-", 0); 
StringBuilder sb = new StringBuilder();
for (String p : parts) {
    if (p.length() <= 4) {
        sb.append('-').append(p);
    } else {
...
voidincrease(A a, Map map)
increase
AtomicInteger val = map.get(a);
if (val == null) {
    val = new AtomicInteger(1);
    map.put(a, val);
} else {
    val.addAndGet(1);
booleanisPropBlocked(String s)
is Prop Blocked
AtomicInteger i = updatingProps.get(s);
if (i == null) {
    return false;
return i.get() > 0;
intloadServiceCount(String id)
load Service Count
AtomicInteger count = m_service_load_count_map.get(id);
if (count == null) {
    count = new AtomicInteger(1);
    m_service_load_count_map.put(id, count);
    return 1;
} else {
    return count.incrementAndGet();
voidprint2DIntArray(int[][] array)
print D Int Array
for (int i = 0; i < array.length; i++) {
    for (int j = 0; j < array[i].length; j++) {
        System.out.print(array[i][j] + " ");
    System.out.println();
voidprintResults(Stream> resultPartitionsStream)
Prints the resultPartitionsStream to the standard out
printResults(resultPartitionsStream, false);
voidreset()
reset
loaderId.set(LOADER_ID_START);