RESOLVED - issue BATCH-809: fixedLenghtTokenizer problem with 1.1.2

Revert changes to Range
This commit is contained in:
dsyer
2008-09-04 08:34:01 +00:00
parent ea1f61ae19
commit 174781ce2b
2 changed files with 16 additions and 4 deletions

View File

@@ -14,11 +14,13 @@ public class Range {
public final static int UPPER_BORDER_NOT_DEFINED = Integer.MAX_VALUE;
final private int min;
final private int max;
private int min;
private int max;
public Range(int min) {
this(min,UPPER_BORDER_NOT_DEFINED);
checkMinMaxValues(min, UPPER_BORDER_NOT_DEFINED);
this.min = min;
this.max = UPPER_BORDER_NOT_DEFINED;
}
public Range(int min, int max) {
@@ -35,6 +37,16 @@ public class Range {
return min;
}
public void setMax(int max) {
checkMinMaxValues(this.min, max);
this.max = max;
}
public void setMin(int min) {
checkMinMaxValues(min, this.max);
this.min = min;
}
public boolean hasMaxValue() {
return max != UPPER_BORDER_NOT_DEFINED;
}

View File

@@ -110,7 +110,7 @@ public class RangeArrayPropertyEditor extends PropertyEditorSupport {
for (int i = 0; i < c.length - 1; i++) {
if (!c[i].hasMaxValue()) {
//set max value to (min value - 1) of the next range
c[i] = new Range(c[i].getMin(),c[i+1].getMin() - 1);
c[i].setMax(c[i+1].getMin() - 1);
}
}