commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject svn commit: r1008161 [43/44] - in /websites/production/commons/content/proper/commons-text: ./ apidocs/ apidocs/org/apache/commons/text/ apidocs/org/apache/commons/text/class-use/ apidocs/org/apache/commons/text/diff/ apidocs/org/apache/commons/text/di...
Date Sun, 12 Mar 2017 02:08:05 GMT
Modified: websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/LookupTranslator.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/LookupTranslator.html (original)
+++ websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/LookupTranslator.html Sun Mar 12 02:08:01 2017
@@ -13,9 +13,9 @@
 <a class="jxr_linenumber" name="L5" href="#L5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
 <a class="jxr_linenumber" name="L6" href="#L6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
 <a class="jxr_linenumber" name="L7" href="#L7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
-<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_comment"> * </em>
+<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_comment"> *</em>
 <a class="jxr_linenumber" name="L9" href="#L9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2." target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.</a>0</em>
-<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_comment"> * </em>
+<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_comment"> *</em>
 <a class="jxr_linenumber" name="L11" href="#L11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
 <a class="jxr_linenumber" name="L12" href="#L12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
 <a class="jxr_linenumber" name="L13" href="#L13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
@@ -39,73 +39,77 @@
 <a class="jxr_linenumber" name="L31" href="#L31">31</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="L32" href="#L32">32</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/commons/text/translate/LookupTranslator.html">LookupTranslator</a> <strong class="jxr_keyword">extends</strong> <a href="../../../../../org/apache/commons/text/translate/CharSequenceTranslator.html">CharSequenceTranslator</a> {
 <a class="jxr_linenumber" name="L33" href="#L33">33</a>  
-<a class="jxr_linenumber" name="L34" href="#L34">34</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> Map&lt;String, String&gt; lookupMap;
-<a class="jxr_linenumber" name="L35" href="#L35">35</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> HashSet&lt;Character&gt; prefixSet;
-<a class="jxr_linenumber" name="L36" href="#L36">36</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> shortest;
-<a class="jxr_linenumber" name="L37" href="#L37">37</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> longest;
-<a class="jxr_linenumber" name="L38" href="#L38">38</a>  
-<a class="jxr_linenumber" name="L39" href="#L39">39</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L40" href="#L40">40</a>  <em class="jxr_javadoccomment">     * Define the lookup table to be used in translation</em>
-<a class="jxr_linenumber" name="L41" href="#L41">41</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L42" href="#L42">42</a>  <em class="jxr_javadoccomment">     * Note that, as of Lang 3.1 (the orgin of this code), the key to the lookup</em>
-<a class="jxr_linenumber" name="L43" href="#L43">43</a>  <em class="jxr_javadoccomment">     * table is converted to a java.lang.String. This is because we need the key</em>
-<a class="jxr_linenumber" name="L44" href="#L44">44</a>  <em class="jxr_javadoccomment">     * to support hashCode and equals(Object), allowing it to be the key for a</em>
-<a class="jxr_linenumber" name="L45" href="#L45">45</a>  <em class="jxr_javadoccomment">     * HashMap. See LANG-882.</em>
-<a class="jxr_linenumber" name="L46" href="#L46">46</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L47" href="#L47">47</a>  <em class="jxr_javadoccomment">     * @param lookupMap Map&amp;lt;CharSequence, CharSequence&amp;gt; table of translator</em>
-<a class="jxr_linenumber" name="L48" href="#L48">48</a>  <em class="jxr_javadoccomment">     *                  mappings</em>
-<a class="jxr_linenumber" name="L49" href="#L49">49</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L50" href="#L50">50</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/commons/text/translate/LookupTranslator.html">LookupTranslator</a>(<strong class="jxr_keyword">final</strong> Map&lt;CharSequence, CharSequence&gt; lookupMap) {
-<a class="jxr_linenumber" name="L51" href="#L51">51</a>          <strong class="jxr_keyword">if</strong> (lookupMap == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L52" href="#L52">52</a>              <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> InvalidParameterException(<span class="jxr_string">"lookupMap cannot be null"</span>);
-<a class="jxr_linenumber" name="L53" href="#L53">53</a>          }
-<a class="jxr_linenumber" name="L54" href="#L54">54</a>          <strong class="jxr_keyword">this</strong>.lookupMap = <strong class="jxr_keyword">new</strong> HashMap&lt;&gt;();
-<a class="jxr_linenumber" name="L55" href="#L55">55</a>          prefixSet = <strong class="jxr_keyword">new</strong> HashSet&lt;&gt;();
-<a class="jxr_linenumber" name="L56" href="#L56">56</a>          <strong class="jxr_keyword">int</strong> _shortest = Integer.MAX_VALUE;
-<a class="jxr_linenumber" name="L57" href="#L57">57</a>          <strong class="jxr_keyword">int</strong> _longest = 0;
-<a class="jxr_linenumber" name="L58" href="#L58">58</a>          Iterator&lt;Map.Entry&lt;CharSequence, CharSequence&gt;&gt; it = lookupMap.entrySet().iterator();
-<a class="jxr_linenumber" name="L59" href="#L59">59</a>  
-<a class="jxr_linenumber" name="L60" href="#L60">60</a>          <strong class="jxr_keyword">while</strong> (it.hasNext()) {
-<a class="jxr_linenumber" name="L61" href="#L61">61</a>              Map.Entry&lt;CharSequence, CharSequence&gt; pair = it.next();
-<a class="jxr_linenumber" name="L62" href="#L62">62</a>              <strong class="jxr_keyword">this</strong>.lookupMap.put(pair.getKey().toString(), pair.getValue().toString());
-<a class="jxr_linenumber" name="L63" href="#L63">63</a>              <strong class="jxr_keyword">this</strong>.prefixSet.add((pair.getKey()).charAt(0));
-<a class="jxr_linenumber" name="L64" href="#L64">64</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> sz = pair.getKey().length();
-<a class="jxr_linenumber" name="L65" href="#L65">65</a>              <strong class="jxr_keyword">if</strong> (sz &lt; _shortest) {
-<a class="jxr_linenumber" name="L66" href="#L66">66</a>                  _shortest = sz;
-<a class="jxr_linenumber" name="L67" href="#L67">67</a>              }
-<a class="jxr_linenumber" name="L68" href="#L68">68</a>              <strong class="jxr_keyword">if</strong> (sz &gt; _longest) {
-<a class="jxr_linenumber" name="L69" href="#L69">69</a>                  _longest = sz;
-<a class="jxr_linenumber" name="L70" href="#L70">70</a>              }
-<a class="jxr_linenumber" name="L71" href="#L71">71</a>          }
-<a class="jxr_linenumber" name="L72" href="#L72">72</a>          shortest = _shortest;
-<a class="jxr_linenumber" name="L73" href="#L73">73</a>          longest = _longest;
-<a class="jxr_linenumber" name="L74" href="#L74">74</a>      }
-<a class="jxr_linenumber" name="L75" href="#L75">75</a>  
-<a class="jxr_linenumber" name="L76" href="#L76">76</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L77" href="#L77">77</a>  <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
-<a class="jxr_linenumber" name="L78" href="#L78">78</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L79" href="#L79">79</a>      @Override
-<a class="jxr_linenumber" name="L80" href="#L80">80</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> translate(<strong class="jxr_keyword">final</strong> CharSequence input, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> index, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="L81" href="#L81">81</a>          <em class="jxr_comment">// check if translation exists for the input at position index</em>
-<a class="jxr_linenumber" name="L82" href="#L82">82</a>          <strong class="jxr_keyword">if</strong> (prefixSet.contains(input.charAt(index))) {
-<a class="jxr_linenumber" name="L83" href="#L83">83</a>              <strong class="jxr_keyword">int</strong> max = longest;
-<a class="jxr_linenumber" name="L84" href="#L84">84</a>              <strong class="jxr_keyword">if</strong> (index + longest &gt; input.length()) {
-<a class="jxr_linenumber" name="L85" href="#L85">85</a>                  max = input.length() - index;
-<a class="jxr_linenumber" name="L86" href="#L86">86</a>              }
-<a class="jxr_linenumber" name="L87" href="#L87">87</a>              <em class="jxr_comment">// implement greedy algorithm by trying maximum match first</em>
-<a class="jxr_linenumber" name="L88" href="#L88">88</a>              <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = max; i &gt;= shortest; i--) {
-<a class="jxr_linenumber" name="L89" href="#L89">89</a>                  <strong class="jxr_keyword">final</strong> CharSequence subSeq = input.subSequence(index, index + i);
-<a class="jxr_linenumber" name="L90" href="#L90">90</a>                  <strong class="jxr_keyword">final</strong> String result = lookupMap.get(subSeq.toString());
-<a class="jxr_linenumber" name="L91" href="#L91">91</a>  
-<a class="jxr_linenumber" name="L92" href="#L92">92</a>                  <strong class="jxr_keyword">if</strong> (result != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L93" href="#L93">93</a>                      out.write(result);
-<a class="jxr_linenumber" name="L94" href="#L94">94</a>                      <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L95" href="#L95">95</a>                  }
-<a class="jxr_linenumber" name="L96" href="#L96">96</a>              }
-<a class="jxr_linenumber" name="L97" href="#L97">97</a>          }
-<a class="jxr_linenumber" name="L98" href="#L98">98</a>          <strong class="jxr_keyword">return</strong> 0;
-<a class="jxr_linenumber" name="L99" href="#L99">99</a>      }
-<a class="jxr_linenumber" name="L100" href="#L100">100</a> }
+<a class="jxr_linenumber" name="L34" href="#L34">34</a>      <em class="jxr_javadoccomment">/** The mapping to be used in translation. */</em>
+<a class="jxr_linenumber" name="L35" href="#L35">35</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> Map&lt;String, String&gt; lookupMap;
+<a class="jxr_linenumber" name="L36" href="#L36">36</a>      <em class="jxr_javadoccomment">/** The first character of each key in the lookupMap. */</em>
+<a class="jxr_linenumber" name="L37" href="#L37">37</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> HashSet&lt;Character&gt; prefixSet;
+<a class="jxr_linenumber" name="L38" href="#L38">38</a>      <em class="jxr_javadoccomment">/** The length of the shortest key in the lookupMap. */</em>
+<a class="jxr_linenumber" name="L39" href="#L39">39</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> shortest;
+<a class="jxr_linenumber" name="L40" href="#L40">40</a>      <em class="jxr_javadoccomment">/** The length of the longest key in the lookupMap. */</em>
+<a class="jxr_linenumber" name="L41" href="#L41">41</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> longest;
+<a class="jxr_linenumber" name="L42" href="#L42">42</a>  
+<a class="jxr_linenumber" name="L43" href="#L43">43</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L44" href="#L44">44</a>  <em class="jxr_javadoccomment">     * Define the lookup table to be used in translation</em>
+<a class="jxr_linenumber" name="L45" href="#L45">45</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L46" href="#L46">46</a>  <em class="jxr_javadoccomment">     * Note that, as of Lang 3.1 (the orgin of this code), the key to the lookup</em>
+<a class="jxr_linenumber" name="L47" href="#L47">47</a>  <em class="jxr_javadoccomment">     * table is converted to a java.lang.String. This is because we need the key</em>
+<a class="jxr_linenumber" name="L48" href="#L48">48</a>  <em class="jxr_javadoccomment">     * to support hashCode and equals(Object), allowing it to be the key for a</em>
+<a class="jxr_linenumber" name="L49" href="#L49">49</a>  <em class="jxr_javadoccomment">     * HashMap. See LANG-882.</em>
+<a class="jxr_linenumber" name="L50" href="#L50">50</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L51" href="#L51">51</a>  <em class="jxr_javadoccomment">     * @param lookupMap Map&amp;lt;CharSequence, CharSequence&amp;gt; table of translator</em>
+<a class="jxr_linenumber" name="L52" href="#L52">52</a>  <em class="jxr_javadoccomment">     *                  mappings</em>
+<a class="jxr_linenumber" name="L53" href="#L53">53</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L54" href="#L54">54</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/commons/text/translate/LookupTranslator.html">LookupTranslator</a>(<strong class="jxr_keyword">final</strong> Map&lt;CharSequence, CharSequence&gt; lookupMap) {
+<a class="jxr_linenumber" name="L55" href="#L55">55</a>          <strong class="jxr_keyword">if</strong> (lookupMap == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L56" href="#L56">56</a>              <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> InvalidParameterException(<span class="jxr_string">"lookupMap cannot be null"</span>);
+<a class="jxr_linenumber" name="L57" href="#L57">57</a>          }
+<a class="jxr_linenumber" name="L58" href="#L58">58</a>          <strong class="jxr_keyword">this</strong>.lookupMap = <strong class="jxr_keyword">new</strong> HashMap&lt;&gt;();
+<a class="jxr_linenumber" name="L59" href="#L59">59</a>          prefixSet = <strong class="jxr_keyword">new</strong> HashSet&lt;&gt;();
+<a class="jxr_linenumber" name="L60" href="#L60">60</a>          <strong class="jxr_keyword">int</strong> _shortest = Integer.MAX_VALUE;
+<a class="jxr_linenumber" name="L61" href="#L61">61</a>          <strong class="jxr_keyword">int</strong> _longest = 0;
+<a class="jxr_linenumber" name="L62" href="#L62">62</a>          Iterator&lt;Map.Entry&lt;CharSequence, CharSequence&gt;&gt; it = lookupMap.entrySet().iterator();
+<a class="jxr_linenumber" name="L63" href="#L63">63</a>  
+<a class="jxr_linenumber" name="L64" href="#L64">64</a>          <strong class="jxr_keyword">while</strong> (it.hasNext()) {
+<a class="jxr_linenumber" name="L65" href="#L65">65</a>              Map.Entry&lt;CharSequence, CharSequence&gt; pair = it.next();
+<a class="jxr_linenumber" name="L66" href="#L66">66</a>              <strong class="jxr_keyword">this</strong>.lookupMap.put(pair.getKey().toString(), pair.getValue().toString());
+<a class="jxr_linenumber" name="L67" href="#L67">67</a>              <strong class="jxr_keyword">this</strong>.prefixSet.add(pair.getKey().charAt(0));
+<a class="jxr_linenumber" name="L68" href="#L68">68</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> sz = pair.getKey().length();
+<a class="jxr_linenumber" name="L69" href="#L69">69</a>              <strong class="jxr_keyword">if</strong> (sz &lt; _shortest) {
+<a class="jxr_linenumber" name="L70" href="#L70">70</a>                  _shortest = sz;
+<a class="jxr_linenumber" name="L71" href="#L71">71</a>              }
+<a class="jxr_linenumber" name="L72" href="#L72">72</a>              <strong class="jxr_keyword">if</strong> (sz &gt; _longest) {
+<a class="jxr_linenumber" name="L73" href="#L73">73</a>                  _longest = sz;
+<a class="jxr_linenumber" name="L74" href="#L74">74</a>              }
+<a class="jxr_linenumber" name="L75" href="#L75">75</a>          }
+<a class="jxr_linenumber" name="L76" href="#L76">76</a>          shortest = _shortest;
+<a class="jxr_linenumber" name="L77" href="#L77">77</a>          longest = _longest;
+<a class="jxr_linenumber" name="L78" href="#L78">78</a>      }
+<a class="jxr_linenumber" name="L79" href="#L79">79</a>  
+<a class="jxr_linenumber" name="L80" href="#L80">80</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L81" href="#L81">81</a>  <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
+<a class="jxr_linenumber" name="L82" href="#L82">82</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L83" href="#L83">83</a>      @Override
+<a class="jxr_linenumber" name="L84" href="#L84">84</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> translate(<strong class="jxr_keyword">final</strong> CharSequence input, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> index, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="L85" href="#L85">85</a>          <em class="jxr_comment">// check if translation exists for the input at position index</em>
+<a class="jxr_linenumber" name="L86" href="#L86">86</a>          <strong class="jxr_keyword">if</strong> (prefixSet.contains(input.charAt(index))) {
+<a class="jxr_linenumber" name="L87" href="#L87">87</a>              <strong class="jxr_keyword">int</strong> max = longest;
+<a class="jxr_linenumber" name="L88" href="#L88">88</a>              <strong class="jxr_keyword">if</strong> (index + longest &gt; input.length()) {
+<a class="jxr_linenumber" name="L89" href="#L89">89</a>                  max = input.length() - index;
+<a class="jxr_linenumber" name="L90" href="#L90">90</a>              }
+<a class="jxr_linenumber" name="L91" href="#L91">91</a>              <em class="jxr_comment">// implement greedy algorithm by trying maximum match first</em>
+<a class="jxr_linenumber" name="L92" href="#L92">92</a>              <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = max; i &gt;= shortest; i--) {
+<a class="jxr_linenumber" name="L93" href="#L93">93</a>                  <strong class="jxr_keyword">final</strong> CharSequence subSeq = input.subSequence(index, index + i);
+<a class="jxr_linenumber" name="L94" href="#L94">94</a>                  <strong class="jxr_keyword">final</strong> String result = lookupMap.get(subSeq.toString());
+<a class="jxr_linenumber" name="L95" href="#L95">95</a>  
+<a class="jxr_linenumber" name="L96" href="#L96">96</a>                  <strong class="jxr_keyword">if</strong> (result != <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L97" href="#L97">97</a>                      out.write(result);
+<a class="jxr_linenumber" name="L98" href="#L98">98</a>                      <strong class="jxr_keyword">return</strong> i;
+<a class="jxr_linenumber" name="L99" href="#L99">99</a>                  }
+<a class="jxr_linenumber" name="L100" href="#L100">100</a>             }
+<a class="jxr_linenumber" name="L101" href="#L101">101</a>         }
+<a class="jxr_linenumber" name="L102" href="#L102">102</a>         <strong class="jxr_keyword">return</strong> 0;
+<a class="jxr_linenumber" name="L103" href="#L103">103</a>     }
+<a class="jxr_linenumber" name="L104" href="#L104">104</a> }
 </pre>
 <hr/>
 <div id="footer">Copyright &#169; 2014&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</div>

Modified: websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/NumericEntityEscaper.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/NumericEntityEscaper.html (original)
+++ websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/NumericEntityEscaper.html Sun Mar 12 02:08:01 2017
@@ -34,96 +34,99 @@
 <a class="jxr_linenumber" name="L26" href="#L26">26</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="L27" href="#L27">27</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> <strong class="jxr_keyword">extends</strong> <a href="../../../../../org/apache/commons/text/translate/CodePointTranslator.html">CodePointTranslator</a> {
 <a class="jxr_linenumber" name="L28" href="#L28">28</a>  
-<a class="jxr_linenumber" name="L29" href="#L29">29</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> below;
-<a class="jxr_linenumber" name="L30" href="#L30">30</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> above;
-<a class="jxr_linenumber" name="L31" href="#L31">31</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> between;
-<a class="jxr_linenumber" name="L32" href="#L32">32</a>  
-<a class="jxr_linenumber" name="L33" href="#L33">33</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L34" href="#L34">34</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; for the specified range. This is</em>
-<a class="jxr_linenumber" name="L35" href="#L35">35</a>  <em class="jxr_javadoccomment">     * the underlying method for the other constructors/builders. The &lt;code&gt;below&lt;/code&gt;</em>
-<a class="jxr_linenumber" name="L36" href="#L36">36</a>  <em class="jxr_javadoccomment">     * and &lt;code&gt;above&lt;/code&gt; boundaries are inclusive when &lt;code&gt;between&lt;/code&gt; is</em>
-<a class="jxr_linenumber" name="L37" href="#L37">37</a>  <em class="jxr_javadoccomment">     * &lt;code&gt;true&lt;/code&gt; and exclusive when it is &lt;code&gt;false&lt;/code&gt;. &lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L38" href="#L38">38</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L39" href="#L39">39</a>  <em class="jxr_javadoccomment">     * @param below int value representing the lowest codepoint boundary</em>
-<a class="jxr_linenumber" name="L40" href="#L40">40</a>  <em class="jxr_javadoccomment">     * @param above int value representing the highest codepoint boundary</em>
-<a class="jxr_linenumber" name="L41" href="#L41">41</a>  <em class="jxr_javadoccomment">     * @param between whether to escape between the boundaries or outside them</em>
-<a class="jxr_linenumber" name="L42" href="#L42">42</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L43" href="#L43">43</a>      <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> below, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> above, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> between) {
-<a class="jxr_linenumber" name="L44" href="#L44">44</a>          <strong class="jxr_keyword">this</strong>.below = below;
-<a class="jxr_linenumber" name="L45" href="#L45">45</a>          <strong class="jxr_keyword">this</strong>.above = above;
-<a class="jxr_linenumber" name="L46" href="#L46">46</a>          <strong class="jxr_keyword">this</strong>.between = between;
-<a class="jxr_linenumber" name="L47" href="#L47">47</a>      }
-<a class="jxr_linenumber" name="L48" href="#L48">48</a>  
-<a class="jxr_linenumber" name="L49" href="#L49">49</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L50" href="#L50">50</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; for all characters. &lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L51" href="#L51">51</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L52" href="#L52">52</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>() {
-<a class="jxr_linenumber" name="L53" href="#L53">53</a>          <strong class="jxr_keyword">this</strong>(0, Integer.MAX_VALUE, <strong class="jxr_keyword">true</strong>);
-<a class="jxr_linenumber" name="L54" href="#L54">54</a>      }
-<a class="jxr_linenumber" name="L55" href="#L55">55</a>  
-<a class="jxr_linenumber" name="L56" href="#L56">56</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L57" href="#L57">57</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; below the specified value (exclusive). &lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L58" href="#L58">58</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L59" href="#L59">59</a>  <em class="jxr_javadoccomment">     * @param codepoint below which to escape</em>
-<a class="jxr_linenumber" name="L60" href="#L60">60</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
-<a class="jxr_linenumber" name="L61" href="#L61">61</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L62" href="#L62">62</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> below(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepoint) {
-<a class="jxr_linenumber" name="L63" href="#L63">63</a>          <strong class="jxr_keyword">return</strong> outsideOf(codepoint, Integer.MAX_VALUE);
-<a class="jxr_linenumber" name="L64" href="#L64">64</a>      }
-<a class="jxr_linenumber" name="L65" href="#L65">65</a>  
-<a class="jxr_linenumber" name="L66" href="#L66">66</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L67" href="#L67">67</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; above the specified value (exclusive). &lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L68" href="#L68">68</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L69" href="#L69">69</a>  <em class="jxr_javadoccomment">     * @param codepoint above which to escape</em>
-<a class="jxr_linenumber" name="L70" href="#L70">70</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
-<a class="jxr_linenumber" name="L71" href="#L71">71</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L72" href="#L72">72</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> above(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepoint) {
-<a class="jxr_linenumber" name="L73" href="#L73">73</a>          <strong class="jxr_keyword">return</strong> outsideOf(0, codepoint);
-<a class="jxr_linenumber" name="L74" href="#L74">74</a>      }
-<a class="jxr_linenumber" name="L75" href="#L75">75</a>  
-<a class="jxr_linenumber" name="L76" href="#L76">76</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L77" href="#L77">77</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; between the specified values (inclusive). &lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L78" href="#L78">78</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L79" href="#L79">79</a>  <em class="jxr_javadoccomment">     * @param codepointLow above which to escape</em>
-<a class="jxr_linenumber" name="L80" href="#L80">80</a>  <em class="jxr_javadoccomment">     * @param codepointHigh below which to escape</em>
-<a class="jxr_linenumber" name="L81" href="#L81">81</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
-<a class="jxr_linenumber" name="L82" href="#L82">82</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L83" href="#L83">83</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> between(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointLow, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointHigh) {
-<a class="jxr_linenumber" name="L84" href="#L84">84</a>          <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>(codepointLow, codepointHigh, <strong class="jxr_keyword">true</strong>);
-<a class="jxr_linenumber" name="L85" href="#L85">85</a>      }
-<a class="jxr_linenumber" name="L86" href="#L86">86</a>  
-<a class="jxr_linenumber" name="L87" href="#L87">87</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L88" href="#L88">88</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; outside of the specified values (exclusive). &lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L89" href="#L89">89</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L90" href="#L90">90</a>  <em class="jxr_javadoccomment">     * @param codepointLow below which to escape</em>
-<a class="jxr_linenumber" name="L91" href="#L91">91</a>  <em class="jxr_javadoccomment">     * @param codepointHigh above which to escape</em>
-<a class="jxr_linenumber" name="L92" href="#L92">92</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
-<a class="jxr_linenumber" name="L93" href="#L93">93</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L94" href="#L94">94</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> outsideOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointLow, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointHigh) {
-<a class="jxr_linenumber" name="L95" href="#L95">95</a>          <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>(codepointLow, codepointHigh, false);
-<a class="jxr_linenumber" name="L96" href="#L96">96</a>      }
-<a class="jxr_linenumber" name="L97" href="#L97">97</a>  
-<a class="jxr_linenumber" name="L98" href="#L98">98</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L99" href="#L99">99</a>  <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
-<a class="jxr_linenumber" name="L100" href="#L100">100</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L101" href="#L101">101</a>     @Override
-<a class="jxr_linenumber" name="L102" href="#L102">102</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> translate(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepoint, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="L103" href="#L103">103</a>         <strong class="jxr_keyword">if</strong>(between) {
-<a class="jxr_linenumber" name="L104" href="#L104">104</a>             <strong class="jxr_keyword">if</strong> (codepoint &lt; below || codepoint &gt; above) {
-<a class="jxr_linenumber" name="L105" href="#L105">105</a>                 <strong class="jxr_keyword">return</strong> false;
-<a class="jxr_linenumber" name="L106" href="#L106">106</a>             }
-<a class="jxr_linenumber" name="L107" href="#L107">107</a>         } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="L108" href="#L108">108</a>             <strong class="jxr_keyword">if</strong> (codepoint &gt;= below &amp;&amp; codepoint &lt;= above) {
-<a class="jxr_linenumber" name="L109" href="#L109">109</a>                 <strong class="jxr_keyword">return</strong> false;
-<a class="jxr_linenumber" name="L110" href="#L110">110</a>             }
-<a class="jxr_linenumber" name="L111" href="#L111">111</a>         }
-<a class="jxr_linenumber" name="L112" href="#L112">112</a> 
-<a class="jxr_linenumber" name="L113" href="#L113">113</a>         out.write(<span class="jxr_string">"&amp;#"</span>);
-<a class="jxr_linenumber" name="L114" href="#L114">114</a>         out.write(Integer.toString(codepoint, 10));
-<a class="jxr_linenumber" name="L115" href="#L115">115</a>         out.write(';');
-<a class="jxr_linenumber" name="L116" href="#L116">116</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="L117" href="#L117">117</a>     }
-<a class="jxr_linenumber" name="L118" href="#L118">118</a> }
+<a class="jxr_linenumber" name="L29" href="#L29">29</a>      <em class="jxr_javadoccomment">/** int value representing the lowest codepoint boundary. */</em>
+<a class="jxr_linenumber" name="L30" href="#L30">30</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> below;
+<a class="jxr_linenumber" name="L31" href="#L31">31</a>      <em class="jxr_javadoccomment">/** int value representing the highest codepoint boundary. */</em>
+<a class="jxr_linenumber" name="L32" href="#L32">32</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> above;
+<a class="jxr_linenumber" name="L33" href="#L33">33</a>      <em class="jxr_javadoccomment">/** whether to escape between the boundaries or outside them. */</em>
+<a class="jxr_linenumber" name="L34" href="#L34">34</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> between;
+<a class="jxr_linenumber" name="L35" href="#L35">35</a>  
+<a class="jxr_linenumber" name="L36" href="#L36">36</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L37" href="#L37">37</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; for the specified range. This is</em>
+<a class="jxr_linenumber" name="L38" href="#L38">38</a>  <em class="jxr_javadoccomment">     * the underlying method for the other constructors/builders. The &lt;code&gt;below&lt;/code&gt;</em>
+<a class="jxr_linenumber" name="L39" href="#L39">39</a>  <em class="jxr_javadoccomment">     * and &lt;code&gt;above&lt;/code&gt; boundaries are inclusive when &lt;code&gt;between&lt;/code&gt; is</em>
+<a class="jxr_linenumber" name="L40" href="#L40">40</a>  <em class="jxr_javadoccomment">     * &lt;code&gt;true&lt;/code&gt; and exclusive when it is &lt;code&gt;false&lt;/code&gt;. &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L41" href="#L41">41</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L42" href="#L42">42</a>  <em class="jxr_javadoccomment">     * @param below int value representing the lowest codepoint boundary</em>
+<a class="jxr_linenumber" name="L43" href="#L43">43</a>  <em class="jxr_javadoccomment">     * @param above int value representing the highest codepoint boundary</em>
+<a class="jxr_linenumber" name="L44" href="#L44">44</a>  <em class="jxr_javadoccomment">     * @param between whether to escape between the boundaries or outside them</em>
+<a class="jxr_linenumber" name="L45" href="#L45">45</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L46" href="#L46">46</a>      <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> below, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> above, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> between) {
+<a class="jxr_linenumber" name="L47" href="#L47">47</a>          <strong class="jxr_keyword">this</strong>.below = below;
+<a class="jxr_linenumber" name="L48" href="#L48">48</a>          <strong class="jxr_keyword">this</strong>.above = above;
+<a class="jxr_linenumber" name="L49" href="#L49">49</a>          <strong class="jxr_keyword">this</strong>.between = between;
+<a class="jxr_linenumber" name="L50" href="#L50">50</a>      }
+<a class="jxr_linenumber" name="L51" href="#L51">51</a>  
+<a class="jxr_linenumber" name="L52" href="#L52">52</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L53" href="#L53">53</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; for all characters. &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L54" href="#L54">54</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L55" href="#L55">55</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>() {
+<a class="jxr_linenumber" name="L56" href="#L56">56</a>          <strong class="jxr_keyword">this</strong>(0, Integer.MAX_VALUE, <strong class="jxr_keyword">true</strong>);
+<a class="jxr_linenumber" name="L57" href="#L57">57</a>      }
+<a class="jxr_linenumber" name="L58" href="#L58">58</a>  
+<a class="jxr_linenumber" name="L59" href="#L59">59</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L60" href="#L60">60</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; below the specified value (exclusive). &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L61" href="#L61">61</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L62" href="#L62">62</a>  <em class="jxr_javadoccomment">     * @param codepoint below which to escape</em>
+<a class="jxr_linenumber" name="L63" href="#L63">63</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
+<a class="jxr_linenumber" name="L64" href="#L64">64</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L65" href="#L65">65</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> below(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepoint) {
+<a class="jxr_linenumber" name="L66" href="#L66">66</a>          <strong class="jxr_keyword">return</strong> outsideOf(codepoint, Integer.MAX_VALUE);
+<a class="jxr_linenumber" name="L67" href="#L67">67</a>      }
+<a class="jxr_linenumber" name="L68" href="#L68">68</a>  
+<a class="jxr_linenumber" name="L69" href="#L69">69</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L70" href="#L70">70</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; above the specified value (exclusive). &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L71" href="#L71">71</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L72" href="#L72">72</a>  <em class="jxr_javadoccomment">     * @param codepoint above which to escape</em>
+<a class="jxr_linenumber" name="L73" href="#L73">73</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
+<a class="jxr_linenumber" name="L74" href="#L74">74</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L75" href="#L75">75</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> above(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepoint) {
+<a class="jxr_linenumber" name="L76" href="#L76">76</a>          <strong class="jxr_keyword">return</strong> outsideOf(0, codepoint);
+<a class="jxr_linenumber" name="L77" href="#L77">77</a>      }
+<a class="jxr_linenumber" name="L78" href="#L78">78</a>  
+<a class="jxr_linenumber" name="L79" href="#L79">79</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L80" href="#L80">80</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; between the specified values (inclusive). &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L81" href="#L81">81</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L82" href="#L82">82</a>  <em class="jxr_javadoccomment">     * @param codepointLow above which to escape</em>
+<a class="jxr_linenumber" name="L83" href="#L83">83</a>  <em class="jxr_javadoccomment">     * @param codepointHigh below which to escape</em>
+<a class="jxr_linenumber" name="L84" href="#L84">84</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
+<a class="jxr_linenumber" name="L85" href="#L85">85</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L86" href="#L86">86</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> between(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointLow, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointHigh) {
+<a class="jxr_linenumber" name="L87" href="#L87">87</a>          <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>(codepointLow, codepointHigh, <strong class="jxr_keyword">true</strong>);
+<a class="jxr_linenumber" name="L88" href="#L88">88</a>      }
+<a class="jxr_linenumber" name="L89" href="#L89">89</a>  
+<a class="jxr_linenumber" name="L90" href="#L90">90</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L91" href="#L91">91</a>  <em class="jxr_javadoccomment">     * &lt;p&gt;Constructs a &lt;code&gt;NumericEntityEscaper&lt;/code&gt; outside of the specified values (exclusive). &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L92" href="#L92">92</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L93" href="#L93">93</a>  <em class="jxr_javadoccomment">     * @param codepointLow below which to escape</em>
+<a class="jxr_linenumber" name="L94" href="#L94">94</a>  <em class="jxr_javadoccomment">     * @param codepointHigh above which to escape</em>
+<a class="jxr_linenumber" name="L95" href="#L95">95</a>  <em class="jxr_javadoccomment">     * @return the newly created {@code NumericEntityEscaper} instance</em>
+<a class="jxr_linenumber" name="L96" href="#L96">96</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L97" href="#L97">97</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a> outsideOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointLow, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepointHigh) {
+<a class="jxr_linenumber" name="L98" href="#L98">98</a>          <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityEscaper.html">NumericEntityEscaper</a>(codepointLow, codepointHigh, false);
+<a class="jxr_linenumber" name="L99" href="#L99">99</a>      }
+<a class="jxr_linenumber" name="L100" href="#L100">100</a> 
+<a class="jxr_linenumber" name="L101" href="#L101">101</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L102" href="#L102">102</a> <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
+<a class="jxr_linenumber" name="L103" href="#L103">103</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L104" href="#L104">104</a>     @Override
+<a class="jxr_linenumber" name="L105" href="#L105">105</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> translate(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> codepoint, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="L106" href="#L106">106</a>         <strong class="jxr_keyword">if</strong> (between) {
+<a class="jxr_linenumber" name="L107" href="#L107">107</a>             <strong class="jxr_keyword">if</strong> (codepoint &lt; below || codepoint &gt; above) {
+<a class="jxr_linenumber" name="L108" href="#L108">108</a>                 <strong class="jxr_keyword">return</strong> false;
+<a class="jxr_linenumber" name="L109" href="#L109">109</a>             }
+<a class="jxr_linenumber" name="L110" href="#L110">110</a>         } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="L111" href="#L111">111</a>             <strong class="jxr_keyword">if</strong> (codepoint &gt;= below &amp;&amp; codepoint &lt;= above) {
+<a class="jxr_linenumber" name="L112" href="#L112">112</a>                 <strong class="jxr_keyword">return</strong> false;
+<a class="jxr_linenumber" name="L113" href="#L113">113</a>             }
+<a class="jxr_linenumber" name="L114" href="#L114">114</a>         }
+<a class="jxr_linenumber" name="L115" href="#L115">115</a> 
+<a class="jxr_linenumber" name="L116" href="#L116">116</a>         out.write(<span class="jxr_string">"&amp;#"</span>);
+<a class="jxr_linenumber" name="L117" href="#L117">117</a>         out.write(Integer.toString(codepoint, 10));
+<a class="jxr_linenumber" name="L118" href="#L118">118</a>         out.write(';');
+<a class="jxr_linenumber" name="L119" href="#L119">119</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="L120" href="#L120">120</a>     }
+<a class="jxr_linenumber" name="L121" href="#L121">121</a> }
 </pre>
 <hr/>
 <div id="footer">Copyright &#169; 2014&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</div>

Modified: websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/NumericEntityUnescaper.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/NumericEntityUnescaper.html (original)
+++ websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/NumericEntityUnescaper.html Sun Mar 12 02:08:01 2017
@@ -13,9 +13,9 @@
 <a class="jxr_linenumber" name="L5" href="#L5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
 <a class="jxr_linenumber" name="L6" href="#L6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
 <a class="jxr_linenumber" name="L7" href="#L7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
-<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_comment"> * </em>
+<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_comment"> *</em>
 <a class="jxr_linenumber" name="L9" href="#L9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2." target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.</a>0</em>
-<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_comment"> * </em>
+<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_comment"> *</em>
 <a class="jxr_linenumber" name="L11" href="#L11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
 <a class="jxr_linenumber" name="L12" href="#L12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
 <a class="jxr_linenumber" name="L13" href="#L13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
@@ -30,7 +30,7 @@
 <a class="jxr_linenumber" name="L22" href="#L22">22</a>  <strong class="jxr_keyword">import</strong> java.util.EnumSet;
 <a class="jxr_linenumber" name="L23" href="#L23">23</a>  
 <a class="jxr_linenumber" name="L24" href="#L24">24</a>  <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L25" href="#L25">25</a>  <em class="jxr_javadoccomment"> * Translate XML numeric entities of the form &amp;amp;#[xX]?\d+;? to </em>
+<a class="jxr_linenumber" name="L25" href="#L25">25</a>  <em class="jxr_javadoccomment"> * Translate XML numeric entities of the form &amp;amp;#[xX]?\d+;? to</em>
 <a class="jxr_linenumber" name="L26" href="#L26">26</a>  <em class="jxr_javadoccomment"> * the specific codepoint.</em>
 <a class="jxr_linenumber" name="L27" href="#L27">27</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="L28" href="#L28">28</a>  <em class="jxr_javadoccomment"> * Note that the semi-colon is optional.</em>
@@ -39,111 +39,112 @@
 <a class="jxr_linenumber" name="L31" href="#L31">31</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="L32" href="#L32">32</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">NumericEntityUnescaper</a> <strong class="jxr_keyword">extends</strong> <a href="../../../../../org/apache/commons/text/translate/CharSequenceTranslator.html">CharSequenceTranslator</a> {
 <a class="jxr_linenumber" name="L33" href="#L33">33</a>  
-<a class="jxr_linenumber" name="L34" href="#L34">34</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> enum <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">OPTION</a> { semiColonRequired, semiColonOptional, errorIfNoSemiColon }
-<a class="jxr_linenumber" name="L35" href="#L35">35</a>  
-<a class="jxr_linenumber" name="L36" href="#L36">36</a>      <em class="jxr_comment">// TODO?: Create an OptionsSet class to hide some of the conditional logic below</em>
-<a class="jxr_linenumber" name="L37" href="#L37">37</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> EnumSet&lt;OPTION&gt; options;
-<a class="jxr_linenumber" name="L38" href="#L38">38</a>  
-<a class="jxr_linenumber" name="L39" href="#L39">39</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L40" href="#L40">40</a>  <em class="jxr_javadoccomment">     * Create a UnicodeUnescaper.</em>
-<a class="jxr_linenumber" name="L41" href="#L41">41</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L42" href="#L42">42</a>  <em class="jxr_javadoccomment">     * The constructor takes a list of options, only one type of which is currently </em>
-<a class="jxr_linenumber" name="L43" href="#L43">43</a>  <em class="jxr_javadoccomment">     * available (whether to allow, error or ignore the semi-colon on the end of a </em>
-<a class="jxr_linenumber" name="L44" href="#L44">44</a>  <em class="jxr_javadoccomment">     * numeric entity to being missing).</em>
-<a class="jxr_linenumber" name="L45" href="#L45">45</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L46" href="#L46">46</a>  <em class="jxr_javadoccomment">     * For example, to support numeric entities without a ';':</em>
-<a class="jxr_linenumber" name="L47" href="#L47">47</a>  <em class="jxr_javadoccomment">     *    new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.semiColonOptional)</em>
-<a class="jxr_linenumber" name="L48" href="#L48">48</a>  <em class="jxr_javadoccomment">     * and to throw an IllegalArgumentException when they're missing:</em>
-<a class="jxr_linenumber" name="L49" href="#L49">49</a>  <em class="jxr_javadoccomment">     *    new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.errorIfNoSemiColon)</em>
-<a class="jxr_linenumber" name="L50" href="#L50">50</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L51" href="#L51">51</a>  <em class="jxr_javadoccomment">     * Note that the default behaviour is to ignore them. </em>
-<a class="jxr_linenumber" name="L52" href="#L52">52</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L53" href="#L53">53</a>  <em class="jxr_javadoccomment">     * @param options to apply to this unescaper</em>
-<a class="jxr_linenumber" name="L54" href="#L54">54</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L55" href="#L55">55</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">NumericEntityUnescaper</a>(<strong class="jxr_keyword">final</strong> OPTION... options) {
-<a class="jxr_linenumber" name="L56" href="#L56">56</a>          <strong class="jxr_keyword">if</strong>(options.length &gt; 0) {
-<a class="jxr_linenumber" name="L57" href="#L57">57</a>              <strong class="jxr_keyword">this</strong>.options = EnumSet.copyOf(Arrays.asList(options));
-<a class="jxr_linenumber" name="L58" href="#L58">58</a>          } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="L59" href="#L59">59</a>              <strong class="jxr_keyword">this</strong>.options = EnumSet.copyOf(Arrays.asList(<strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">OPTION</a>[] { OPTION.semiColonRequired }));
-<a class="jxr_linenumber" name="L60" href="#L60">60</a>          }
-<a class="jxr_linenumber" name="L61" href="#L61">61</a>      }
-<a class="jxr_linenumber" name="L62" href="#L62">62</a>  
-<a class="jxr_linenumber" name="L63" href="#L63">63</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L64" href="#L64">64</a>  <em class="jxr_javadoccomment">     * Whether the passed in option is currently set.</em>
-<a class="jxr_linenumber" name="L65" href="#L65">65</a>  <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L66" href="#L66">66</a>  <em class="jxr_javadoccomment">     * @param option to check state of</em>
-<a class="jxr_linenumber" name="L67" href="#L67">67</a>  <em class="jxr_javadoccomment">     * @return whether the option is set</em>
-<a class="jxr_linenumber" name="L68" href="#L68">68</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L69" href="#L69">69</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSet(<strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">OPTION</a> option) { 
-<a class="jxr_linenumber" name="L70" href="#L70">70</a>          <strong class="jxr_keyword">return</strong> options == <strong class="jxr_keyword">null</strong> ? false : options.contains(option);
-<a class="jxr_linenumber" name="L71" href="#L71">71</a>      }
-<a class="jxr_linenumber" name="L72" href="#L72">72</a>  
-<a class="jxr_linenumber" name="L73" href="#L73">73</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L74" href="#L74">74</a>  <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
-<a class="jxr_linenumber" name="L75" href="#L75">75</a>  <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L76" href="#L76">76</a>      @Override
-<a class="jxr_linenumber" name="L77" href="#L77">77</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> translate(<strong class="jxr_keyword">final</strong> CharSequence input, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> index, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
-<a class="jxr_linenumber" name="L78" href="#L78">78</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> seqEnd = input.length();
-<a class="jxr_linenumber" name="L79" href="#L79">79</a>          <em class="jxr_comment">// Uses -2 to ensure there is something after the &amp;#</em>
-<a class="jxr_linenumber" name="L80" href="#L80">80</a>          <strong class="jxr_keyword">if</strong>(input.charAt(index) == '&amp;' &amp;&amp; index &lt; seqEnd - 2 &amp;&amp; input.charAt(index + 1) == '#') {
-<a class="jxr_linenumber" name="L81" href="#L81">81</a>              <strong class="jxr_keyword">int</strong> start = index + 2;
-<a class="jxr_linenumber" name="L82" href="#L82">82</a>              <strong class="jxr_keyword">boolean</strong> isHex = false;
-<a class="jxr_linenumber" name="L83" href="#L83">83</a>  
-<a class="jxr_linenumber" name="L84" href="#L84">84</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">char</strong> firstChar = input.charAt(start);
-<a class="jxr_linenumber" name="L85" href="#L85">85</a>              <strong class="jxr_keyword">if</strong>(firstChar == 'x' || firstChar == 'X') {
-<a class="jxr_linenumber" name="L86" href="#L86">86</a>                  start++;
-<a class="jxr_linenumber" name="L87" href="#L87">87</a>                  isHex = <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="L88" href="#L88">88</a>  
-<a class="jxr_linenumber" name="L89" href="#L89">89</a>                  <em class="jxr_comment">// Check there's more than just an x after the &amp;#</em>
-<a class="jxr_linenumber" name="L90" href="#L90">90</a>                  <strong class="jxr_keyword">if</strong>(start == seqEnd) {
-<a class="jxr_linenumber" name="L91" href="#L91">91</a>                      <strong class="jxr_keyword">return</strong> 0;
-<a class="jxr_linenumber" name="L92" href="#L92">92</a>                  }
-<a class="jxr_linenumber" name="L93" href="#L93">93</a>              }
-<a class="jxr_linenumber" name="L94" href="#L94">94</a>  
-<a class="jxr_linenumber" name="L95" href="#L95">95</a>              <strong class="jxr_keyword">int</strong> end = start;
-<a class="jxr_linenumber" name="L96" href="#L96">96</a>              <em class="jxr_comment">// Note that this supports character codes without a ; on the end</em>
-<a class="jxr_linenumber" name="L97" href="#L97">97</a>              <strong class="jxr_keyword">while</strong>(end &lt; seqEnd &amp;&amp; ( input.charAt(end) &gt;= '0' &amp;&amp; input.charAt(end) &lt;= '9' ||
-<a class="jxr_linenumber" name="L98" href="#L98">98</a>                                      input.charAt(end) &gt;= 'a' &amp;&amp; input.charAt(end) &lt;= 'f' ||
-<a class="jxr_linenumber" name="L99" href="#L99">99</a>                                      input.charAt(end) &gt;= 'A' &amp;&amp; input.charAt(end) &lt;= 'F' ) )
-<a class="jxr_linenumber" name="L100" href="#L100">100</a>             {
+<a class="jxr_linenumber" name="L34" href="#L34">34</a>      <em class="jxr_javadoccomment">/** NumericEntityUnescaper option enum. */</em>
+<a class="jxr_linenumber" name="L35" href="#L35">35</a>      <strong class="jxr_keyword">public</strong> enum <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">OPTION</a> { semiColonRequired, semiColonOptional, errorIfNoSemiColon }
+<a class="jxr_linenumber" name="L36" href="#L36">36</a>  
+<a class="jxr_linenumber" name="L37" href="#L37">37</a>      <em class="jxr_javadoccomment">/** EnumSet of OPTIONS, given from the constructor. */</em>
+<a class="jxr_linenumber" name="L38" href="#L38">38</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> EnumSet&lt;OPTION&gt; options;
+<a class="jxr_linenumber" name="L39" href="#L39">39</a>  
+<a class="jxr_linenumber" name="L40" href="#L40">40</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L41" href="#L41">41</a>  <em class="jxr_javadoccomment">     * Create a UnicodeUnescaper.</em>
+<a class="jxr_linenumber" name="L42" href="#L42">42</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L43" href="#L43">43</a>  <em class="jxr_javadoccomment">     * The constructor takes a list of options, only one type of which is currently</em>
+<a class="jxr_linenumber" name="L44" href="#L44">44</a>  <em class="jxr_javadoccomment">     * available (whether to allow, error or ignore the semi-colon on the end of a</em>
+<a class="jxr_linenumber" name="L45" href="#L45">45</a>  <em class="jxr_javadoccomment">     * numeric entity to being missing).</em>
+<a class="jxr_linenumber" name="L46" href="#L46">46</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L47" href="#L47">47</a>  <em class="jxr_javadoccomment">     * For example, to support numeric entities without a ';':</em>
+<a class="jxr_linenumber" name="L48" href="#L48">48</a>  <em class="jxr_javadoccomment">     *    new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.semiColonOptional)</em>
+<a class="jxr_linenumber" name="L49" href="#L49">49</a>  <em class="jxr_javadoccomment">     * and to throw an IllegalArgumentException when they're missing:</em>
+<a class="jxr_linenumber" name="L50" href="#L50">50</a>  <em class="jxr_javadoccomment">     *    new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.errorIfNoSemiColon)</em>
+<a class="jxr_linenumber" name="L51" href="#L51">51</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L52" href="#L52">52</a>  <em class="jxr_javadoccomment">     * Note that the default behaviour is to ignore them.</em>
+<a class="jxr_linenumber" name="L53" href="#L53">53</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L54" href="#L54">54</a>  <em class="jxr_javadoccomment">     * @param options to apply to this unescaper</em>
+<a class="jxr_linenumber" name="L55" href="#L55">55</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L56" href="#L56">56</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">NumericEntityUnescaper</a>(<strong class="jxr_keyword">final</strong> OPTION... options) {
+<a class="jxr_linenumber" name="L57" href="#L57">57</a>          <strong class="jxr_keyword">if</strong> (options.length &gt; 0) {
+<a class="jxr_linenumber" name="L58" href="#L58">58</a>              <strong class="jxr_keyword">this</strong>.options = EnumSet.copyOf(Arrays.asList(options));
+<a class="jxr_linenumber" name="L59" href="#L59">59</a>          } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="L60" href="#L60">60</a>              <strong class="jxr_keyword">this</strong>.options = EnumSet.copyOf(Arrays.asList(<strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">OPTION</a>[] {OPTION.semiColonRequired}));
+<a class="jxr_linenumber" name="L61" href="#L61">61</a>          }
+<a class="jxr_linenumber" name="L62" href="#L62">62</a>      }
+<a class="jxr_linenumber" name="L63" href="#L63">63</a>  
+<a class="jxr_linenumber" name="L64" href="#L64">64</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L65" href="#L65">65</a>  <em class="jxr_javadoccomment">     * Whether the passed in option is currently set.</em>
+<a class="jxr_linenumber" name="L66" href="#L66">66</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L67" href="#L67">67</a>  <em class="jxr_javadoccomment">     * @param option to check state of</em>
+<a class="jxr_linenumber" name="L68" href="#L68">68</a>  <em class="jxr_javadoccomment">     * @return whether the option is set</em>
+<a class="jxr_linenumber" name="L69" href="#L69">69</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L70" href="#L70">70</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSet(<strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/commons/text/translate/NumericEntityUnescaper.html">OPTION</a> option) {
+<a class="jxr_linenumber" name="L71" href="#L71">71</a>          <strong class="jxr_keyword">return</strong> options != <strong class="jxr_keyword">null</strong> &amp;&amp; options.contains(option);
+<a class="jxr_linenumber" name="L72" href="#L72">72</a>      }
+<a class="jxr_linenumber" name="L73" href="#L73">73</a>  
+<a class="jxr_linenumber" name="L74" href="#L74">74</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L75" href="#L75">75</a>  <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
+<a class="jxr_linenumber" name="L76" href="#L76">76</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L77" href="#L77">77</a>      @Override
+<a class="jxr_linenumber" name="L78" href="#L78">78</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> translate(<strong class="jxr_keyword">final</strong> CharSequence input, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> index, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
+<a class="jxr_linenumber" name="L79" href="#L79">79</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> seqEnd = input.length();
+<a class="jxr_linenumber" name="L80" href="#L80">80</a>          <em class="jxr_comment">// Uses -2 to ensure there is something after the &amp;#</em>
+<a class="jxr_linenumber" name="L81" href="#L81">81</a>          <strong class="jxr_keyword">if</strong> (input.charAt(index) == '&amp;' &amp;&amp; index &lt; seqEnd - 2 &amp;&amp; input.charAt(index + 1) == '#') {
+<a class="jxr_linenumber" name="L82" href="#L82">82</a>              <strong class="jxr_keyword">int</strong> start = index + 2;
+<a class="jxr_linenumber" name="L83" href="#L83">83</a>              <strong class="jxr_keyword">boolean</strong> isHex = false;
+<a class="jxr_linenumber" name="L84" href="#L84">84</a>  
+<a class="jxr_linenumber" name="L85" href="#L85">85</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">char</strong> firstChar = input.charAt(start);
+<a class="jxr_linenumber" name="L86" href="#L86">86</a>              <strong class="jxr_keyword">if</strong> (firstChar == 'x' || firstChar == 'X') {
+<a class="jxr_linenumber" name="L87" href="#L87">87</a>                  start++;
+<a class="jxr_linenumber" name="L88" href="#L88">88</a>                  isHex = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="L89" href="#L89">89</a>  
+<a class="jxr_linenumber" name="L90" href="#L90">90</a>                  <em class="jxr_comment">// Check there's more than just an x after the &amp;#</em>
+<a class="jxr_linenumber" name="L91" href="#L91">91</a>                  <strong class="jxr_keyword">if</strong> (start == seqEnd) {
+<a class="jxr_linenumber" name="L92" href="#L92">92</a>                      <strong class="jxr_keyword">return</strong> 0;
+<a class="jxr_linenumber" name="L93" href="#L93">93</a>                  }
+<a class="jxr_linenumber" name="L94" href="#L94">94</a>              }
+<a class="jxr_linenumber" name="L95" href="#L95">95</a>  
+<a class="jxr_linenumber" name="L96" href="#L96">96</a>              <strong class="jxr_keyword">int</strong> end = start;
+<a class="jxr_linenumber" name="L97" href="#L97">97</a>              <em class="jxr_comment">// Note that this supports character codes without a ; on the end</em>
+<a class="jxr_linenumber" name="L98" href="#L98">98</a>              <strong class="jxr_keyword">while</strong> (end &lt; seqEnd &amp;&amp; (input.charAt(end) &gt;= '0' &amp;&amp; input.charAt(end) &lt;= '9'
+<a class="jxr_linenumber" name="L99" href="#L99">99</a>                                      || input.charAt(end) &gt;= 'a' &amp;&amp; input.charAt(end) &lt;= 'f'
+<a class="jxr_linenumber" name="L100" href="#L100">100</a>                                     || input.charAt(end) &gt;= 'A' &amp;&amp; input.charAt(end) &lt;= 'F')) {
 <a class="jxr_linenumber" name="L101" href="#L101">101</a>                 end++;
 <a class="jxr_linenumber" name="L102" href="#L102">102</a>             }
 <a class="jxr_linenumber" name="L103" href="#L103">103</a> 
 <a class="jxr_linenumber" name="L104" href="#L104">104</a>             <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> semiNext = end != seqEnd &amp;&amp; input.charAt(end) == ';';
 <a class="jxr_linenumber" name="L105" href="#L105">105</a> 
-<a class="jxr_linenumber" name="L106" href="#L106">106</a>             <strong class="jxr_keyword">if</strong>(!semiNext) {
-<a class="jxr_linenumber" name="L107" href="#L107">107</a>                 <strong class="jxr_keyword">if</strong>(isSet(OPTION.semiColonRequired)) {
+<a class="jxr_linenumber" name="L106" href="#L106">106</a>             <strong class="jxr_keyword">if</strong> (!semiNext) {
+<a class="jxr_linenumber" name="L107" href="#L107">107</a>                 <strong class="jxr_keyword">if</strong> (isSet(OPTION.semiColonRequired)) {
 <a class="jxr_linenumber" name="L108" href="#L108">108</a>                     <strong class="jxr_keyword">return</strong> 0;
-<a class="jxr_linenumber" name="L109" href="#L109">109</a>                 } <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L110" href="#L110">110</a>                 <strong class="jxr_keyword">if</strong>(isSet(OPTION.errorIfNoSemiColon)) {
-<a class="jxr_linenumber" name="L111" href="#L111">111</a>                     <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IllegalArgumentException(<span class="jxr_string">"Semi-colon required at end of numeric entity"</span>);
-<a class="jxr_linenumber" name="L112" href="#L112">112</a>                 }
-<a class="jxr_linenumber" name="L113" href="#L113">113</a>             }
-<a class="jxr_linenumber" name="L114" href="#L114">114</a> 
-<a class="jxr_linenumber" name="L115" href="#L115">115</a>             <strong class="jxr_keyword">int</strong> entityValue;
-<a class="jxr_linenumber" name="L116" href="#L116">116</a>             <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="L117" href="#L117">117</a>                 <strong class="jxr_keyword">if</strong>(isHex) {
-<a class="jxr_linenumber" name="L118" href="#L118">118</a>                     entityValue = Integer.parseInt(input.subSequence(start, end).toString(), 16);
-<a class="jxr_linenumber" name="L119" href="#L119">119</a>                 } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="L120" href="#L120">120</a>                     entityValue = Integer.parseInt(input.subSequence(start, end).toString(), 10);
-<a class="jxr_linenumber" name="L121" href="#L121">121</a>                 }
-<a class="jxr_linenumber" name="L122" href="#L122">122</a>             } <strong class="jxr_keyword">catch</strong>(<strong class="jxr_keyword">final</strong> NumberFormatException nfe) {
-<a class="jxr_linenumber" name="L123" href="#L123">123</a>                 <strong class="jxr_keyword">return</strong> 0;
-<a class="jxr_linenumber" name="L124" href="#L124">124</a>             }
-<a class="jxr_linenumber" name="L125" href="#L125">125</a> 
-<a class="jxr_linenumber" name="L126" href="#L126">126</a>             <strong class="jxr_keyword">if</strong>(entityValue &gt; 0xFFFF) {
-<a class="jxr_linenumber" name="L127" href="#L127">127</a>                 <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">char</strong>[] chrs = Character.toChars(entityValue);
-<a class="jxr_linenumber" name="L128" href="#L128">128</a>                 out.write(chrs[0]);
-<a class="jxr_linenumber" name="L129" href="#L129">129</a>                 out.write(chrs[1]);
-<a class="jxr_linenumber" name="L130" href="#L130">130</a>             } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="L131" href="#L131">131</a>                 out.write(entityValue);
-<a class="jxr_linenumber" name="L132" href="#L132">132</a>             }
-<a class="jxr_linenumber" name="L133" href="#L133">133</a> 
-<a class="jxr_linenumber" name="L134" href="#L134">134</a>             <strong class="jxr_keyword">return</strong> 2 + end - start + (isHex ? 1 : 0) + (semiNext ? 1 : 0);
-<a class="jxr_linenumber" name="L135" href="#L135">135</a>         }
-<a class="jxr_linenumber" name="L136" href="#L136">136</a>         <strong class="jxr_keyword">return</strong> 0;
-<a class="jxr_linenumber" name="L137" href="#L137">137</a>     }
-<a class="jxr_linenumber" name="L138" href="#L138">138</a> }
+<a class="jxr_linenumber" name="L109" href="#L109">109</a>                 } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="L110" href="#L110">110</a>                     <strong class="jxr_keyword">if</strong> (isSet(OPTION.errorIfNoSemiColon)) {
+<a class="jxr_linenumber" name="L111" href="#L111">111</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IllegalArgumentException(<span class="jxr_string">"Semi-colon required at end of numeric entity"</span>);
+<a class="jxr_linenumber" name="L112" href="#L112">112</a>                     }
+<a class="jxr_linenumber" name="L113" href="#L113">113</a>                 }
+<a class="jxr_linenumber" name="L114" href="#L114">114</a>             }
+<a class="jxr_linenumber" name="L115" href="#L115">115</a> 
+<a class="jxr_linenumber" name="L116" href="#L116">116</a>             <strong class="jxr_keyword">int</strong> entityValue;
+<a class="jxr_linenumber" name="L117" href="#L117">117</a>             <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="L118" href="#L118">118</a>                 <strong class="jxr_keyword">if</strong> (isHex) {
+<a class="jxr_linenumber" name="L119" href="#L119">119</a>                     entityValue = Integer.parseInt(input.subSequence(start, end).toString(), 16);
+<a class="jxr_linenumber" name="L120" href="#L120">120</a>                 } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="L121" href="#L121">121</a>                     entityValue = Integer.parseInt(input.subSequence(start, end).toString(), 10);
+<a class="jxr_linenumber" name="L122" href="#L122">122</a>                 }
+<a class="jxr_linenumber" name="L123" href="#L123">123</a>             } <strong class="jxr_keyword">catch</strong> (<strong class="jxr_keyword">final</strong> NumberFormatException nfe) {
+<a class="jxr_linenumber" name="L124" href="#L124">124</a>                 <strong class="jxr_keyword">return</strong> 0;
+<a class="jxr_linenumber" name="L125" href="#L125">125</a>             }
+<a class="jxr_linenumber" name="L126" href="#L126">126</a> 
+<a class="jxr_linenumber" name="L127" href="#L127">127</a>             <strong class="jxr_keyword">if</strong> (entityValue &gt; 0xFFFF) {
+<a class="jxr_linenumber" name="L128" href="#L128">128</a>                 <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">char</strong>[] chrs = Character.toChars(entityValue);
+<a class="jxr_linenumber" name="L129" href="#L129">129</a>                 out.write(chrs[0]);
+<a class="jxr_linenumber" name="L130" href="#L130">130</a>                 out.write(chrs[1]);
+<a class="jxr_linenumber" name="L131" href="#L131">131</a>             } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="L132" href="#L132">132</a>                 out.write(entityValue);
+<a class="jxr_linenumber" name="L133" href="#L133">133</a>             }
+<a class="jxr_linenumber" name="L134" href="#L134">134</a> 
+<a class="jxr_linenumber" name="L135" href="#L135">135</a>             <strong class="jxr_keyword">return</strong> 2 + end - start + (isHex ? 1 : 0) + (semiNext ? 1 : 0);
+<a class="jxr_linenumber" name="L136" href="#L136">136</a>         }
+<a class="jxr_linenumber" name="L137" href="#L137">137</a>         <strong class="jxr_keyword">return</strong> 0;
+<a class="jxr_linenumber" name="L138" href="#L138">138</a>     }
+<a class="jxr_linenumber" name="L139" href="#L139">139</a> }
 </pre>
 <hr/>
 <div id="footer">Copyright &#169; 2014&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</div>

Modified: websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/OctalUnescaper.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/OctalUnescaper.html (original)
+++ websites/production/commons/content/proper/commons-text/xref/org/apache/commons/text/translate/OctalUnescaper.html Sun Mar 12 02:08:01 2017
@@ -13,9 +13,9 @@
 <a class="jxr_linenumber" name="L5" href="#L5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
 <a class="jxr_linenumber" name="L6" href="#L6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
 <a class="jxr_linenumber" name="L7" href="#L7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
-<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_comment"> * </em>
+<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_comment"> *</em>
 <a class="jxr_linenumber" name="L9" href="#L9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2." target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.</a>0</em>
-<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_comment"> * </em>
+<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_comment"> *</em>
 <a class="jxr_linenumber" name="L11" href="#L11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
 <a class="jxr_linenumber" name="L12" href="#L12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
 <a class="jxr_linenumber" name="L13" href="#L13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
@@ -32,7 +32,7 @@
 <a class="jxr_linenumber" name="L24" href="#L24">24</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="L25" href="#L25">25</a>  <em class="jxr_javadoccomment"> * For example, "\45" should go back to being the specific value (a %).</em>
 <a class="jxr_linenumber" name="L26" href="#L26">26</a>  <em class="jxr_javadoccomment"> *</em>
-<a class="jxr_linenumber" name="L27" href="#L27">27</a>  <em class="jxr_javadoccomment"> * Note that this currently only supports the viable range of octal for Java; namely </em>
+<a class="jxr_linenumber" name="L27" href="#L27">27</a>  <em class="jxr_javadoccomment"> * Note that this currently only supports the viable range of octal for Java; namely</em>
 <a class="jxr_linenumber" name="L28" href="#L28">28</a>  <em class="jxr_javadoccomment"> * 1 to 377. This is because parsing Java is the main use case.</em>
 <a class="jxr_linenumber" name="L29" href="#L29">29</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="L30" href="#L30">30</a>  <em class="jxr_javadoccomment"> * @since 1.0</em>
@@ -46,7 +46,7 @@
 <a class="jxr_linenumber" name="L38" href="#L38">38</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">int</strong> translate(<strong class="jxr_keyword">final</strong> CharSequence input, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> index, <strong class="jxr_keyword">final</strong> Writer out) <strong class="jxr_keyword">throws</strong> IOException {
 <a class="jxr_linenumber" name="L39" href="#L39">39</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> remaining = input.length() - index - 1; <em class="jxr_comment">// how many characters left, ignoring the first \</em>
 <a class="jxr_linenumber" name="L40" href="#L40">40</a>          <strong class="jxr_keyword">final</strong> StringBuilder builder = <strong class="jxr_keyword">new</strong> StringBuilder();
-<a class="jxr_linenumber" name="L41" href="#L41">41</a>          <strong class="jxr_keyword">if</strong>(input.charAt(index) == '&#92;&#92;' &amp;&amp; remaining &gt; 0 &amp;&amp; isOctalDigit(input.charAt(index + 1)) ) {
+<a class="jxr_linenumber" name="L41" href="#L41">41</a>          <strong class="jxr_keyword">if</strong> (input.charAt(index) == '&#92;&#92;' &amp;&amp; remaining &gt; 0 &amp;&amp; isOctalDigit(input.charAt(index + 1))) {
 <a class="jxr_linenumber" name="L42" href="#L42">42</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> next = index + 1;
 <a class="jxr_linenumber" name="L43" href="#L43">43</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> next2 = index + 2;
 <a class="jxr_linenumber" name="L44" href="#L44">44</a>              <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> next3 = index + 3;
@@ -54,14 +54,14 @@
 <a class="jxr_linenumber" name="L46" href="#L46">46</a>              <em class="jxr_comment">// we know this is good as we checked it in the if block above</em>
 <a class="jxr_linenumber" name="L47" href="#L47">47</a>              builder.append(input.charAt(next));
 <a class="jxr_linenumber" name="L48" href="#L48">48</a>  
-<a class="jxr_linenumber" name="L49" href="#L49">49</a>              <strong class="jxr_keyword">if</strong>(remaining &gt; 1 &amp;&amp; isOctalDigit(input.charAt(next2))) {
+<a class="jxr_linenumber" name="L49" href="#L49">49</a>              <strong class="jxr_keyword">if</strong> (remaining &gt; 1 &amp;&amp; isOctalDigit(input.charAt(next2))) {
 <a class="jxr_linenumber" name="L50" href="#L50">50</a>                  builder.append(input.charAt(next2));
-<a class="jxr_linenumber" name="L51" href="#L51">51</a>                  <strong class="jxr_keyword">if</strong>(remaining &gt; 2 &amp;&amp; isZeroToThree(input.charAt(next)) &amp;&amp; isOctalDigit(input.charAt(next3))) {
+<a class="jxr_linenumber" name="L51" href="#L51">51</a>                  <strong class="jxr_keyword">if</strong> (remaining &gt; 2 &amp;&amp; isZeroToThree(input.charAt(next)) &amp;&amp; isOctalDigit(input.charAt(next3))) {
 <a class="jxr_linenumber" name="L52" href="#L52">52</a>                      builder.append(input.charAt(next3));
 <a class="jxr_linenumber" name="L53" href="#L53">53</a>                  }
 <a class="jxr_linenumber" name="L54" href="#L54">54</a>              }
 <a class="jxr_linenumber" name="L55" href="#L55">55</a>  
-<a class="jxr_linenumber" name="L56" href="#L56">56</a>              out.write( Integer.parseInt(builder.toString(), 8) );
+<a class="jxr_linenumber" name="L56" href="#L56">56</a>              out.write(Integer.parseInt(builder.toString(), 8));
 <a class="jxr_linenumber" name="L57" href="#L57">57</a>              <strong class="jxr_keyword">return</strong> 1 + builder.length();
 <a class="jxr_linenumber" name="L58" href="#L58">58</a>          }
 <a class="jxr_linenumber" name="L59" href="#L59">59</a>          <strong class="jxr_keyword">return</strong> 0;



Mime
View raw message