List of utility methods to do AtomicInteger
Map | getExceptionCountMap() get Exception Count Map return getCountMap(exceptionCount);
|
Set | getFailedMiddlePartNumbers(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()); ... |
int | getGetPendingWrTransaction() get Get Pending Wr Transaction return pendingWrTransaction.get();
|
String | getGuid(Object clazz) get Guid return getGuid();
|
int | getId() get Id return id.getAndIncrement();
|
int | getInstanceCounter(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(); ... |
Object | getLock() get Lock int index = lockIndex.incrementAndGet(); if (index >= LOCK.length) { index = 0; lockIndex.set(index); return LOCK[index]; |
int | getNextCounter(AtomicInteger counter) get Next Counter return counter.incrementAndGet();
|
int | getNextId() get Next Id return (id.getAndIncrement() & ID_MASK) + ID_BASE;
|
String | getNextTempQueueName() get Next Temp Queue Name return "tempq" + tempQueueId.getAndDecrement(); |