Skip to content
Snippets Groups Projects
Commit 196da32b authored by Christian Wulf's avatar Christian Wulf
Browse files

added CounterState

parent 013c1c14
No related tags found
No related merge requests found
#FindBugs User Preferences #FindBugs User Preferences
#Wed Jan 28 07:11:46 CET 2015 #Tue Mar 17 16:58:49 CET 2015
detector_threshold=3 detector_threshold=3
effort=max effort=max
excludefilter0=.fbExcludeFilterFile|true excludefilter0=.fbExcludeFilterFile|true
......
package teetime.util;
import java.util.Set;
public class CounterState {
private final Set<CounterState> allCounters;
private int value;
public CounterState(final Set<CounterState> allCounters) {
super();
this.allCounters = allCounters;
}
// value operation (+)
public int inc(final int rightSummand) {
value += rightSummand;
return value;
}
public int getValue() {
return value;
}
// combine operation (+)
public int getThreadGlobalValue() {
int sum = 0;
for (CounterState counterState : allCounters) {
sum += counterState.getValue();
}
return sum;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment