1 package com.stateofflow.eclipse.metrics.calculators.linesofcode;
2
3 class LinesOfCode {
4 private int loc;
5 private int lastStatementLine;
6
7 public void checkAndIncrement(final int lineNumber) {
8 if (lineNumber > lastStatementLine) {
9 loc++;
10 lastStatementLine = lineNumber;
11 }
12 }
13
14 public int getCount() {
15 return loc;
16 }
17
18 public void setCount( int count ) {
19 loc = count;
20 }
21
22 public void increment(final int amount) {
23 loc += amount;
24 }
25
26 public void initialise(final int startLineNumber) {
27 loc = 0;
28 lastStatementLine = startLineNumber;
29 }
30 }
31