01: /*
02: * Created on 31.05.2005
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package de.schlund.pfixxml.perflogging;
08:
09: /**
10: * @author jh
11: *
12: */
13: public class Interval {
14: private long from;
15: private long until;
16:
17: Interval(long from, long until) {
18: this .from = from;
19: this .until = until;
20: }
21:
22: boolean contains(long value) {
23: boolean ret = (value >= from && value < until);
24: //System.out.println("Contains: "+value+":"+ret+"-->"+toString());
25: return ret;
26: }
27:
28: boolean isGreater(long value) {
29: boolean ret = value >= until;
30: //System.out.println("greater: "+value+":"+ret+"-->"+toString());
31: return ret;
32: }
33:
34: boolean isLess(long value) {
35: boolean ret = value < from;
36: //System.out.println("less: "+value+":"+ret+"-->"+toString());
37: return ret;
38: }
39:
40: public long getFrom() {
41: return from;
42: }
43:
44: public long getUntil() {
45: return until;
46: }
47:
48: public String toString() {
49: return "[" + from + "-" + until + "]";
50: }
51:
52: }
|