~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/model/NTA/trace/ValueRange.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package dk.aau.cs.TA.trace;
 
1
package dk.aau.cs.model.NTA.trace;
2
2
 
3
3
import java.math.BigDecimal;
4
4
 
7
7
        private BigDecimal lower = BigDecimal.ZERO;
8
8
        private BigDecimal upper = new BigDecimal(Long.MAX_VALUE);
9
9
        private boolean upperStrict = false;
10
 
        
11
 
        public ValueRange(){
12
 
                
 
10
 
 
11
        public ValueRange() {
 
12
 
13
13
        }
14
 
        
15
 
        public ValueRange(boolean lowerStrict, BigDecimal lower, BigDecimal upper, boolean upperStrict){
 
14
 
 
15
        public ValueRange(boolean lowerStrict, BigDecimal lower, BigDecimal upper,
 
16
                        boolean upperStrict) {
16
17
                this.lowerStrict = lowerStrict;
17
18
                this.lower = lower;
18
19
                this.upper = upper;
19
 
                this.upperStrict = upperStrict; 
 
20
                this.upperStrict = upperStrict;
20
21
        }
21
 
        
22
 
        public boolean hasExactValue(){
 
22
 
 
23
        public boolean hasExactValue() {
23
24
                return lower.equals(upper);
24
25
        }
25
 
        
26
 
        public boolean lowerIncluded(){
 
26
 
 
27
        public boolean lowerIncluded() {
27
28
                return !lowerStrict;
28
29
        }
29
 
                
30
 
        public BigDecimal lower(){
 
30
 
 
31
        public BigDecimal lower() {
31
32
                return lower;
32
33
        }
33
 
        
34
 
        public BigDecimal upper(){
 
34
 
 
35
        public BigDecimal upper() {
35
36
                return upper;
36
37
        }
37
 
                
38
 
        public boolean upperIncluded(){
 
38
 
 
39
        public boolean upperIncluded() {
39
40
                return !upperStrict;
40
41
        }
41
 
        
42
 
        public void setLowerIncluded(boolean included){
 
42
 
 
43
        public void setLowerIncluded(boolean included) {
43
44
                lowerStrict = !included;
44
45
        }
45
 
        
46
 
        public void setLower(BigDecimal lower){
 
46
 
 
47
        public void setLower(BigDecimal lower) {
47
48
                this.lower = lower;
48
49
        }
49
 
        
50
 
        public void setUpper(BigDecimal upper){
 
50
 
 
51
        public void setUpper(BigDecimal upper) {
51
52
                this.upper = upper;
52
53
        }
53
 
        
54
 
        public void setUpperIncluded(boolean included){
 
54
 
 
55
        public void setUpperIncluded(boolean included) {
55
56
                upperStrict = !included;
56
57
        }
57
58
}