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

MapgetExceptionCountMap()
get Exception Count Map
return getCountMap(exceptionCount);
SetgetFailedMiddlePartNumbers(PartListing partListing)
get Failed Middle Part Numbers
AtomicInteger lastPartNumber = new AtomicInteger(0);
Set<Integer> uploadedParts = partListing.getParts().stream().map(PartSummary::getPartNumber).peek(n -> {
    if (lastPartNumber.get() < n) {
        lastPartNumber.set(n);
}).collect(Collectors.toSet());
return IntStream.range(1, lastPartNumber.get()).filter(n -> !uploadedParts.contains(n)).boxed()
        .collect(Collectors.toSet());
...
intgetGetPendingWrTransaction()
get Get Pending Wr Transaction
return pendingWrTransaction.get();
StringgetGuid(Object clazz)
get Guid
return getGuid();
intgetId()
get Id
return id.getAndIncrement();
intgetInstanceCounter(String name)
Returns a new counter for instance with core-name 'name'.
AtomicInteger counter = instanceCounters.get(name);
if (counter != null)
    return counter.incrementAndGet();
counter = new AtomicInteger(0);
AtomicInteger old = instanceCounters.putIfAbsent(name, counter);
if (old != null)
    counter = old;
return counter.incrementAndGet();
...
ObjectgetLock()
get Lock
int index = lockIndex.incrementAndGet();
if (index >= LOCK.length) {
    index = 0;
    lockIndex.set(index);
return LOCK[index];
intgetNextCounter(AtomicInteger counter)
get Next Counter
return counter.incrementAndGet();
intgetNextId()
get Next Id
return (id.getAndIncrement() & ID_MASK) + ID_BASE;
StringgetNextTempQueueName()
get Next Temp Queue Name
return "tempq" + tempQueueId.getAndDecrement();