01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.pp;
12:
13: /**
14: * A class specifying a range of integer numbers e.g. character positions.
15: */
16:
17: public class Range {
18: int start = -1;
19: int end = -1;
20:
21: public Range(int s, int e) {
22: start = s;
23: end = e;
24: }
25:
26: public Range(Range r) {
27: start = r.start;
28: end = r.end;
29: }
30:
31: public int start() {
32: return start;
33: }
34:
35: public int end() {
36: return end;
37: }
38:
39: public int length() {
40: return end - start;
41: }
42:
43: public String toString() {
44: return "[ Start = " + start + " ; End = " + end + " ]";
45: }
46: }
|