aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-12-06 16:46:09 +0000
committerPJ Fanning <fanningpj@apache.org>2020-12-06 16:46:09 +0000
commitbb52df5d007b8585be518522bd4b55feb106639f (patch)
treed3d8f45e2270df74631fb4c528a0d01d7b0c4da9
parent07cb9eeb2630b545a19eaf62c438218a1a87454e (diff)
downloadpoi-bb52df5d007b8585be518522bd4b55feb106639f.tar.gz
poi-bb52df5d007b8585be518522bd4b55feb106639f.zip
make FontGroup.Range more JavaBean-like
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884157 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java b/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java
index 0433b5d6a1..cdbaefe90f 100644
--- a/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java
+++ b/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java
@@ -65,12 +65,15 @@ public enum FontGroup {
}
private static class Range {
- final int upper;
- final FontGroup fontGroup;
+ private final int upper;
+ private final FontGroup fontGroup;
Range(int upper, FontGroup fontGroup) {
this.upper = upper;
this.fontGroup = fontGroup;
}
+
+ int getUpper() { return upper; }
+ FontGroup getFontGroup() { return fontGroup; }
}
private static NavigableMap<Integer,Range> UCS_RANGES;
@@ -154,8 +157,8 @@ public enum FontGroup {
private static FontGroup lookup(int codepoint) {
// Do a lookup for a match in UCS_RANGES
- Map.Entry<Integer,Range> entry = UCS_RANGES.floorEntry(codepoint);
+ Map.Entry<Integer, Range> entry = UCS_RANGES.floorEntry(codepoint);
Range range = (entry != null) ? entry.getValue() : null;
- return (range != null && codepoint <= range.upper) ? range.fontGroup : EAST_ASIAN;
+ return (range != null && codepoint <= range.getUpper()) ? range.getFontGroup() : EAST_ASIAN;
}
} \ No newline at end of file