1   package com.stateofflow.eclipse.metrics.calculators.levels;
2   
3   final class MaximumLevel {
4       private int methodMaximum;
5       private int classMaximum;
6   
7       public MaximumLevel() {
8       }
9   
10      public MaximumLevel(final MaximumLevel toCopy) {
11          methodMaximum = toCopy.methodMaximum;
12          classMaximum = toCopy.classMaximum;
13      }
14  
15      public int getClassMaximum() {
16          return classMaximum;
17      }
18  
19      public int getMethodMaximum() {
20          return methodMaximum;
21      }
22  
23      public void startMethod() {
24          methodMaximum = 1;
25      }
26  
27      public void startType() {
28          classMaximum = 1;
29      }
30  
31      public void takeMaximum(final int levels) {
32          methodMaximum = Math.max(levels, methodMaximum);
33          classMaximum = Math.max(levels, classMaximum);
34      }
35  }
36