From bb52df5d007b8585be518522bd4b55feb106639f Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sun, 6 Dec 2020 16:46:09 +0000 Subject: [PATCH] make FontGroup.Range more JavaBean-like git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884157 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/common/usermodel/fonts/FontGroup.java | 11 +++++++---- 1 file 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 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 entry = UCS_RANGES.floorEntry(codepoint); + Map.Entry 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 -- 2.39.5