Making the private fields final via Sebb's patch from LANG-540

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@828944 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-10-23 06:46:02 +00:00
parent 6ef494b6f4
commit ba0205c202

View File

@ -25,9 +25,19 @@
*/ */
public class UnicodeEscaper extends CodePointTranslator { public class UnicodeEscaper extends CodePointTranslator {
private int below = 0; private final int below;
private int above = Integer.MAX_VALUE; private final int above;
private boolean between = true; private final boolean between;
public UnicodeEscaper(){
this(0, Integer.MAX_VALUE, true);
}
private UnicodeEscaper(int below, int above, boolean between) {
this.below = below;
this.above = above;
this.between = between;
}
public static UnicodeEscaper below(int codepoint) { public static UnicodeEscaper below(int codepoint) {
return outsideOf(codepoint, Integer.MAX_VALUE); return outsideOf(codepoint, Integer.MAX_VALUE);
@ -38,17 +48,12 @@ public static UnicodeEscaper above(int codepoint) {
} }
public static UnicodeEscaper outsideOf(int codepointLow, int codepointHigh) { public static UnicodeEscaper outsideOf(int codepointLow, int codepointHigh) {
UnicodeEscaper escaper = new UnicodeEscaper(); UnicodeEscaper escaper = new UnicodeEscaper(codepointLow, codepointHigh, false);
escaper.above = codepointHigh;
escaper.below = codepointLow;
escaper.between = false;
return escaper; return escaper;
} }
public static UnicodeEscaper between(int codepointLow, int codepointHigh) { public static UnicodeEscaper between(int codepointLow, int codepointHigh) {
UnicodeEscaper escaper = new UnicodeEscaper(); UnicodeEscaper escaper = new UnicodeEscaper(codepointLow, codepointHigh, true);
escaper.above = codepointHigh;
escaper.below = codepointLow;
return escaper; return escaper;
} }