public interface SharedCounters
| Modifier and Type | Method and Description |
|---|---|
long |
add(int index,
long i)
Adds
i to the counter at index. |
void |
decrement(int index)
Decrements the counter at
index by 1. |
long |
decrementAndRead(int index)
Decrements the counter at
index by 1 and returns the new count. |
long[] |
getCounterValues()
Returns the values of the counters in an array.
|
void |
increment(int index)
Increments the counter at
index by 1. |
long |
incrementAndRead(int index)
Increments the counter at
index by 1 and returns the new count. |
long |
read(int index)
Returns the current value of the counter at index.
|
void |
setIfLarger(int index,
long i)
Sets the counter at
index to i only if
i is greater than the current count. |
void |
setIfSmaller(int index,
long i)
Sets the counter at
index to i only if
i is less than the current count. |
long |
subtract(int index,
long i)
Subtracts
i from the counter at index. |
void |
zero(int index)
Sets the counter at
index to 0. |
long read(int index)
long add(int index,
long i)
i to the counter at index.long subtract(int index,
long i)
i from the counter at index.void increment(int index)
index by 1.void decrement(int index)
index by 1.long incrementAndRead(int index)
index by 1 and returns the new count.long decrementAndRead(int index)
index by 1 and returns the new count.void zero(int index)
index to 0.void setIfLarger(int index,
long i)
index to i only if
i is greater than the current count. This is a convenient
way to track a maximum value.void setIfSmaller(int index,
long i)
index to i only if
i is less than the current count. This is a convenient
way to track a minimum value.long[] getCounterValues()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.