• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / learnlib / 6606273736

22 Oct 2023 09:20PM UTC coverage: 93.278% (+0.06%) from 93.218%
6606273736

push

github

mtf90
s/fromCharSequence/fromString/g

8 of 8 new or added lines in 1 file covered. (100.0%)

11545 of 12377 relevant lines covered (93.28%)

1.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/filters/statistics/src/main/java/de/learnlib/filter/statistic/Counter.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of LearnLib, http://www.learnlib.de/.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package de.learnlib.filter.statistic;
18

19
import java.util.concurrent.atomic.AtomicLong;
20

21
/**
22
 * simple counter.
23
 */
24
public class Counter extends AbstractStatisticData {
25

26
    private final AtomicLong count = new AtomicLong(0L);
2✔
27

28
    public Counter(String name, String unit) {
29
        super(name, unit);
2✔
30
    }
2✔
31

32
    public void increment(long inc) {
33
        count.addAndGet(inc);
2✔
34
    }
2✔
35

36
    public void increment() {
37
        count.incrementAndGet();
2✔
38
    }
2✔
39

40
    public long getCount() {
41
        return count.get();
2✔
42
    }
43

44
    @Override
45
    public String toString() {
46
        return getDetails();
×
47
    }
48

49
    @Override
50
    public String getSummary() {
51
        return getName() + " [" + getUnit() + "]: " + count;
1✔
52
    }
53

54
    @Override
55
    public String getDetails() {
56
        return getSummary();
1✔
57
    }
58

59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc