Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TeeTime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathis Neumann
TeeTime
Commits
196da32b
Commit
196da32b
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
added CounterState
parent
013c1c14
Branches
reduction-variable
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.settings/edu.umd.cs.findbugs.core.prefs
+1
-1
1 addition, 1 deletion
.settings/edu.umd.cs.findbugs.core.prefs
src/main/java/teetime/util/CounterState.java
+35
-0
35 additions, 0 deletions
src/main/java/teetime/util/CounterState.java
with
36 additions
and
1 deletion
.settings/edu.umd.cs.findbugs.core.prefs
+
1
−
1
View file @
196da32b
#FindBugs User Preferences
#FindBugs User Preferences
#
Wed Jan 28 07:11
:4
6
CET 2015
#
Tue Mar 17 16:58
:4
9
CET 2015
detector_threshold=3
detector_threshold=3
effort=max
effort=max
excludefilter0=.fbExcludeFilterFile|true
excludefilter0=.fbExcludeFilterFile|true
...
...
This diff is collapsed.
Click to expand it.
src/main/java/teetime/util/CounterState.java
0 → 100644
+
35
−
0
View file @
196da32b
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
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment