commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r889932 [30/33] - in /websites/production/commons/content/proper/commons-codec: ./ apidocs/ apidocs/org/apache/commons/codec/ apidocs/org/apache/commons/codec/binary/ apidocs/org/apache/commons/codec/binary/class-use/ apidocs/org/apache/com...
Date Wed, 11 Dec 2013 04:34:52 GMT
Modified: websites/production/commons/content/proper/commons-codec/xref/org/apache/commons/codec/language/bm/Lang.html
==============================================================================
--- websites/production/commons/content/proper/commons-codec/xref/org/apache/commons/codec/language/bm/Lang.html (original)
+++ websites/production/commons/content/proper/commons-codec/xref/org/apache/commons/codec/language/bm/Lang.html Wed Dec 11 04:34:40 2013
@@ -76,7 +76,7 @@
 <a class="jxr_linenumber" name="66" href="#66">66</a>  <em class="jxr_javadoccomment"> * Port of lang.php</em>
 <a class="jxr_linenumber" name="67" href="#67">67</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="68" href="#68">68</a>  <em class="jxr_javadoccomment"> * @since 1.6</em>
-<a class="jxr_linenumber" name="69" href="#69">69</a>  <em class="jxr_javadoccomment"> * @version $Id: Lang.java 1429868 2013-01-07 16:08:05Z ggregory $</em>
+<a class="jxr_linenumber" name="69" href="#69">69</a>  <em class="jxr_javadoccomment"> * @version $Id: Lang.java 1542813 2013-11-17 20:52:32Z tn $</em>
 <a class="jxr_linenumber" name="70" href="#70">70</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="71" href="#71">71</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">Lang</a> {
 <a class="jxr_linenumber" name="72" href="#72">72</a>      <em class="jxr_comment">// Implementation note: This class is divided into two sections. The first part is a static factory interface that</em>
@@ -145,98 +145,100 @@
 <a class="jxr_linenumber" name="135" href="#135">135</a>         }
 <a class="jxr_linenumber" name="136" href="#136">136</a> 
 <a class="jxr_linenumber" name="137" href="#137">137</a>         <strong class="jxr_keyword">final</strong> Scanner scanner = <strong class="jxr_keyword">new</strong> Scanner(lRulesIS, ResourceConstants.ENCODING);
-<a class="jxr_linenumber" name="138" href="#138">138</a>         <strong class="jxr_keyword">boolean</strong> inExtendedComment = false;
-<a class="jxr_linenumber" name="139" href="#139">139</a>         <strong class="jxr_keyword">while</strong> (scanner.hasNextLine()) {
-<a class="jxr_linenumber" name="140" href="#140">140</a>             <strong class="jxr_keyword">final</strong> String rawLine = scanner.nextLine();
-<a class="jxr_linenumber" name="141" href="#141">141</a>             String line = rawLine;
-<a class="jxr_linenumber" name="142" href="#142">142</a> 
-<a class="jxr_linenumber" name="143" href="#143">143</a>             <strong class="jxr_keyword">if</strong> (inExtendedComment) {
-<a class="jxr_linenumber" name="144" href="#144">144</a>                 <em class="jxr_comment">// check for closing comment marker, otherwise discard doc comment line</em>
-<a class="jxr_linenumber" name="145" href="#145">145</a>                 <strong class="jxr_keyword">if</strong> (line.endsWith(ResourceConstants.EXT_CMT_END)) {
-<a class="jxr_linenumber" name="146" href="#146">146</a>                     inExtendedComment = false;
-<a class="jxr_linenumber" name="147" href="#147">147</a>                 }
-<a class="jxr_linenumber" name="148" href="#148">148</a>             } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="149" href="#149">149</a>                 <strong class="jxr_keyword">if</strong> (line.startsWith(ResourceConstants.EXT_CMT_START)) {
-<a class="jxr_linenumber" name="150" href="#150">150</a>                     inExtendedComment = <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="151" href="#151">151</a>                 } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="152" href="#152">152</a>                     <em class="jxr_comment">// discard comments</em>
-<a class="jxr_linenumber" name="153" href="#153">153</a>                     <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> cmtI = line.indexOf(ResourceConstants.CMT);
-<a class="jxr_linenumber" name="154" href="#154">154</a>                     <strong class="jxr_keyword">if</strong> (cmtI &gt;= 0) {
-<a class="jxr_linenumber" name="155" href="#155">155</a>                         line = line.substring(0, cmtI);
-<a class="jxr_linenumber" name="156" href="#156">156</a>                     }
+<a class="jxr_linenumber" name="138" href="#138">138</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="139" href="#139">139</a>             <strong class="jxr_keyword">boolean</strong> inExtendedComment = false;
+<a class="jxr_linenumber" name="140" href="#140">140</a>             <strong class="jxr_keyword">while</strong> (scanner.hasNextLine()) {
+<a class="jxr_linenumber" name="141" href="#141">141</a>                 <strong class="jxr_keyword">final</strong> String rawLine = scanner.nextLine();
+<a class="jxr_linenumber" name="142" href="#142">142</a>                 String line = rawLine;
+<a class="jxr_linenumber" name="143" href="#143">143</a>                 <strong class="jxr_keyword">if</strong> (inExtendedComment) {
+<a class="jxr_linenumber" name="144" href="#144">144</a>                     <em class="jxr_comment">// check for closing comment marker, otherwise discard doc comment line</em>
+<a class="jxr_linenumber" name="145" href="#145">145</a>                     <strong class="jxr_keyword">if</strong> (line.endsWith(ResourceConstants.EXT_CMT_END)) {
+<a class="jxr_linenumber" name="146" href="#146">146</a>                         inExtendedComment = false;
+<a class="jxr_linenumber" name="147" href="#147">147</a>                     }
+<a class="jxr_linenumber" name="148" href="#148">148</a>                 } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="149" href="#149">149</a>                     <strong class="jxr_keyword">if</strong> (line.startsWith(ResourceConstants.EXT_CMT_START)) {
+<a class="jxr_linenumber" name="150" href="#150">150</a>                         inExtendedComment = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="151" href="#151">151</a>                     } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="152" href="#152">152</a>                         <em class="jxr_comment">// discard comments</em>
+<a class="jxr_linenumber" name="153" href="#153">153</a>                         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> cmtI = line.indexOf(ResourceConstants.CMT);
+<a class="jxr_linenumber" name="154" href="#154">154</a>                         <strong class="jxr_keyword">if</strong> (cmtI &gt;= 0) {
+<a class="jxr_linenumber" name="155" href="#155">155</a>                             line = line.substring(0, cmtI);
+<a class="jxr_linenumber" name="156" href="#156">156</a>                         }
 <a class="jxr_linenumber" name="157" href="#157">157</a> 
-<a class="jxr_linenumber" name="158" href="#158">158</a>                     <em class="jxr_comment">// trim leading-trailing whitespace</em>
-<a class="jxr_linenumber" name="159" href="#159">159</a>                     line = line.trim();
+<a class="jxr_linenumber" name="158" href="#158">158</a>                         <em class="jxr_comment">// trim leading-trailing whitespace</em>
+<a class="jxr_linenumber" name="159" href="#159">159</a>                         line = line.trim();
 <a class="jxr_linenumber" name="160" href="#160">160</a> 
-<a class="jxr_linenumber" name="161" href="#161">161</a>                     <strong class="jxr_keyword">if</strong> (line.length() == 0) {
-<a class="jxr_linenumber" name="162" href="#162">162</a>                         <strong class="jxr_keyword">continue</strong>; <em class="jxr_comment">// empty lines can be safely skipped</em>
-<a class="jxr_linenumber" name="163" href="#163">163</a>                     }
+<a class="jxr_linenumber" name="161" href="#161">161</a>                         <strong class="jxr_keyword">if</strong> (line.length() == 0) {
+<a class="jxr_linenumber" name="162" href="#162">162</a>                             <strong class="jxr_keyword">continue</strong>; <em class="jxr_comment">// empty lines can be safely skipped</em>
+<a class="jxr_linenumber" name="163" href="#163">163</a>                         }
 <a class="jxr_linenumber" name="164" href="#164">164</a> 
-<a class="jxr_linenumber" name="165" href="#165">165</a>                     <em class="jxr_comment">// split it up</em>
-<a class="jxr_linenumber" name="166" href="#166">166</a>                     <strong class="jxr_keyword">final</strong> String[] parts = line.split(<span class="jxr_string">"&#92;&#92;s+"</span>);
+<a class="jxr_linenumber" name="165" href="#165">165</a>                         <em class="jxr_comment">// split it up</em>
+<a class="jxr_linenumber" name="166" href="#166">166</a>                         <strong class="jxr_keyword">final</strong> String[] parts = line.split(<span class="jxr_string">"&#92;&#92;s+"</span>);
 <a class="jxr_linenumber" name="167" href="#167">167</a> 
-<a class="jxr_linenumber" name="168" href="#168">168</a>                     <strong class="jxr_keyword">if</strong> (parts.length != 3) {
-<a class="jxr_linenumber" name="169" href="#169">169</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IllegalArgumentException(<span class="jxr_string">"Malformed line '"</span> + rawLine + <span class="jxr_string">"' in language resource '"</span> +
-<a class="jxr_linenumber" name="170" href="#170">170</a>                                                            languageRulesResourceName + <span class="jxr_string">"'"</span>);
-<a class="jxr_linenumber" name="171" href="#171">171</a>                     }
+<a class="jxr_linenumber" name="168" href="#168">168</a>                         <strong class="jxr_keyword">if</strong> (parts.length != 3) {
+<a class="jxr_linenumber" name="169" href="#169">169</a>                             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IllegalArgumentException(<span class="jxr_string">"Malformed line '"</span> + rawLine +
+<a class="jxr_linenumber" name="170" href="#170">170</a>                                     <span class="jxr_string">"' in language resource '"</span> + languageRulesResourceName + <span class="jxr_string">"'"</span>);
+<a class="jxr_linenumber" name="171" href="#171">171</a>                         }
 <a class="jxr_linenumber" name="172" href="#172">172</a> 
-<a class="jxr_linenumber" name="173" href="#173">173</a>                     <strong class="jxr_keyword">final</strong> Pattern pattern = Pattern.compile(parts[0]);
-<a class="jxr_linenumber" name="174" href="#174">174</a>                     <strong class="jxr_keyword">final</strong> String[] langs = parts[1].split(<span class="jxr_string">"&#92;&#92;+"</span>);
-<a class="jxr_linenumber" name="175" href="#175">175</a>                     <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> accept = parts[2].equals(<span class="jxr_string">"true"</span>);
+<a class="jxr_linenumber" name="173" href="#173">173</a>                         <strong class="jxr_keyword">final</strong> Pattern pattern = Pattern.compile(parts[0]);
+<a class="jxr_linenumber" name="174" href="#174">174</a>                         <strong class="jxr_keyword">final</strong> String[] langs = parts[1].split(<span class="jxr_string">"&#92;&#92;+"</span>);
+<a class="jxr_linenumber" name="175" href="#175">175</a>                         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong> accept = parts[2].equals(<span class="jxr_string">"true"</span>);
 <a class="jxr_linenumber" name="176" href="#176">176</a> 
-<a class="jxr_linenumber" name="177" href="#177">177</a>                     rules.add(<strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">LangRule</a>(pattern, <strong class="jxr_keyword">new</strong> HashSet&lt;String&gt;(Arrays.asList(langs)), accept));
-<a class="jxr_linenumber" name="178" href="#178">178</a>                 }
-<a class="jxr_linenumber" name="179" href="#179">179</a>             }
-<a class="jxr_linenumber" name="180" href="#180">180</a>         }
-<a class="jxr_linenumber" name="181" href="#181">181</a> 
-<a class="jxr_linenumber" name="182" href="#182">182</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">Lang</a>(rules, languages);
-<a class="jxr_linenumber" name="183" href="#183">183</a>     }
-<a class="jxr_linenumber" name="184" href="#184">184</a> 
-<a class="jxr_linenumber" name="185" href="#185">185</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a> languages;
-<a class="jxr_linenumber" name="186" href="#186">186</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> List&lt;LangRule&gt; rules;
-<a class="jxr_linenumber" name="187" href="#187">187</a> 
-<a class="jxr_linenumber" name="188" href="#188">188</a>     <strong class="jxr_keyword">private</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">Lang</a>(<strong class="jxr_keyword">final</strong> List&lt;LangRule&gt; rules, <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a> languages) {
-<a class="jxr_linenumber" name="189" href="#189">189</a>         <strong class="jxr_keyword">this</strong>.rules = Collections.unmodifiableList(rules);
-<a class="jxr_linenumber" name="190" href="#190">190</a>         <strong class="jxr_keyword">this</strong>.languages = languages;
-<a class="jxr_linenumber" name="191" href="#191">191</a>     }
-<a class="jxr_linenumber" name="192" href="#192">192</a> 
-<a class="jxr_linenumber" name="193" href="#193">193</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="194" href="#194">194</a> <em class="jxr_javadoccomment">     * Guesses the language of a word.</em>
-<a class="jxr_linenumber" name="195" href="#195">195</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="196" href="#196">196</a> <em class="jxr_javadoccomment">     * @param text</em>
-<a class="jxr_linenumber" name="197" href="#197">197</a> <em class="jxr_javadoccomment">     *            the word</em>
-<a class="jxr_linenumber" name="198" href="#198">198</a> <em class="jxr_javadoccomment">     * @return the language that the word originates from or {@link Languages#ANY} if there was no unique match</em>
-<a class="jxr_linenumber" name="199" href="#199">199</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="200" href="#200">200</a>     <strong class="jxr_keyword">public</strong> String guessLanguage(<strong class="jxr_keyword">final</strong> String text) {
-<a class="jxr_linenumber" name="201" href="#201">201</a>         <strong class="jxr_keyword">final</strong> Languages.LanguageSet ls = guessLanguages(text);
-<a class="jxr_linenumber" name="202" href="#202">202</a>         <strong class="jxr_keyword">return</strong> ls.isSingleton() ? ls.getAny() : Languages.ANY;
-<a class="jxr_linenumber" name="203" href="#203">203</a>     }
-<a class="jxr_linenumber" name="204" href="#204">204</a> 
-<a class="jxr_linenumber" name="205" href="#205">205</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="206" href="#206">206</a> <em class="jxr_javadoccomment">     * Guesses the languages of a word.</em>
-<a class="jxr_linenumber" name="207" href="#207">207</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="208" href="#208">208</a> <em class="jxr_javadoccomment">     * @param input</em>
-<a class="jxr_linenumber" name="209" href="#209">209</a> <em class="jxr_javadoccomment">     *            the word</em>
-<a class="jxr_linenumber" name="210" href="#210">210</a> <em class="jxr_javadoccomment">     * @return a Set of Strings of language names that are potential matches for the input word</em>
-<a class="jxr_linenumber" name="211" href="#211">211</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="212" href="#212">212</a>     <strong class="jxr_keyword">public</strong> Languages.LanguageSet guessLanguages(<strong class="jxr_keyword">final</strong> String input) {
-<a class="jxr_linenumber" name="213" href="#213">213</a>         <strong class="jxr_keyword">final</strong> String text = input.toLowerCase(Locale.ENGLISH);
-<a class="jxr_linenumber" name="214" href="#214">214</a> 
-<a class="jxr_linenumber" name="215" href="#215">215</a>         <strong class="jxr_keyword">final</strong> Set&lt;String&gt; langs = <strong class="jxr_keyword">new</strong> HashSet&lt;String&gt;(<strong class="jxr_keyword">this</strong>.languages.getLanguages());
-<a class="jxr_linenumber" name="216" href="#216">216</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">final</strong> LangRule rule : <strong class="jxr_keyword">this</strong>.rules) {
-<a class="jxr_linenumber" name="217" href="#217">217</a>             <strong class="jxr_keyword">if</strong> (rule.matches(text)) {
-<a class="jxr_linenumber" name="218" href="#218">218</a>                 <strong class="jxr_keyword">if</strong> (rule.acceptOnMatch) {
-<a class="jxr_linenumber" name="219" href="#219">219</a>                     langs.retainAll(rule.languages);
-<a class="jxr_linenumber" name="220" href="#220">220</a>                 } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="221" href="#221">221</a>                     langs.removeAll(rule.languages);
-<a class="jxr_linenumber" name="222" href="#222">222</a>                 }
-<a class="jxr_linenumber" name="223" href="#223">223</a>             }
-<a class="jxr_linenumber" name="224" href="#224">224</a>         }
-<a class="jxr_linenumber" name="225" href="#225">225</a> 
-<a class="jxr_linenumber" name="226" href="#226">226</a>         <strong class="jxr_keyword">final</strong> Languages.LanguageSet ls = Languages.LanguageSet.from(langs);
-<a class="jxr_linenumber" name="227" href="#227">227</a>         <strong class="jxr_keyword">return</strong> ls.equals(Languages.NO_LANGUAGES) ? Languages.ANY_LANGUAGE : ls;
-<a class="jxr_linenumber" name="228" href="#228">228</a>     }
-<a class="jxr_linenumber" name="229" href="#229">229</a> }
+<a class="jxr_linenumber" name="177" href="#177">177</a>                         rules.add(<strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">LangRule</a>(pattern, <strong class="jxr_keyword">new</strong> HashSet&lt;String&gt;(Arrays.asList(langs)), accept));
+<a class="jxr_linenumber" name="178" href="#178">178</a>                     }
+<a class="jxr_linenumber" name="179" href="#179">179</a>                 }
+<a class="jxr_linenumber" name="180" href="#180">180</a>             }
+<a class="jxr_linenumber" name="181" href="#181">181</a>         } <strong class="jxr_keyword">finally</strong> {
+<a class="jxr_linenumber" name="182" href="#182">182</a>             scanner.close();
+<a class="jxr_linenumber" name="183" href="#183">183</a>         }
+<a class="jxr_linenumber" name="184" href="#184">184</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">Lang</a>(rules, languages);
+<a class="jxr_linenumber" name="185" href="#185">185</a>     }
+<a class="jxr_linenumber" name="186" href="#186">186</a> 
+<a class="jxr_linenumber" name="187" href="#187">187</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a> languages;
+<a class="jxr_linenumber" name="188" href="#188">188</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> List&lt;LangRule&gt; rules;
+<a class="jxr_linenumber" name="189" href="#189">189</a> 
+<a class="jxr_linenumber" name="190" href="#190">190</a>     <strong class="jxr_keyword">private</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Lang.html">Lang</a>(<strong class="jxr_keyword">final</strong> List&lt;LangRule&gt; rules, <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a> languages) {
+<a class="jxr_linenumber" name="191" href="#191">191</a>         <strong class="jxr_keyword">this</strong>.rules = Collections.unmodifiableList(rules);
+<a class="jxr_linenumber" name="192" href="#192">192</a>         <strong class="jxr_keyword">this</strong>.languages = languages;
+<a class="jxr_linenumber" name="193" href="#193">193</a>     }
+<a class="jxr_linenumber" name="194" href="#194">194</a> 
+<a class="jxr_linenumber" name="195" href="#195">195</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="196" href="#196">196</a> <em class="jxr_javadoccomment">     * Guesses the language of a word.</em>
+<a class="jxr_linenumber" name="197" href="#197">197</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="198" href="#198">198</a> <em class="jxr_javadoccomment">     * @param text</em>
+<a class="jxr_linenumber" name="199" href="#199">199</a> <em class="jxr_javadoccomment">     *            the word</em>
+<a class="jxr_linenumber" name="200" href="#200">200</a> <em class="jxr_javadoccomment">     * @return the language that the word originates from or {@link Languages#ANY} if there was no unique match</em>
+<a class="jxr_linenumber" name="201" href="#201">201</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="202" href="#202">202</a>     <strong class="jxr_keyword">public</strong> String guessLanguage(<strong class="jxr_keyword">final</strong> String text) {
+<a class="jxr_linenumber" name="203" href="#203">203</a>         <strong class="jxr_keyword">final</strong> Languages.LanguageSet ls = guessLanguages(text);
+<a class="jxr_linenumber" name="204" href="#204">204</a>         <strong class="jxr_keyword">return</strong> ls.isSingleton() ? ls.getAny() : Languages.ANY;
+<a class="jxr_linenumber" name="205" href="#205">205</a>     }
+<a class="jxr_linenumber" name="206" href="#206">206</a> 
+<a class="jxr_linenumber" name="207" href="#207">207</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="208" href="#208">208</a> <em class="jxr_javadoccomment">     * Guesses the languages of a word.</em>
+<a class="jxr_linenumber" name="209" href="#209">209</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="210" href="#210">210</a> <em class="jxr_javadoccomment">     * @param input</em>
+<a class="jxr_linenumber" name="211" href="#211">211</a> <em class="jxr_javadoccomment">     *            the word</em>
+<a class="jxr_linenumber" name="212" href="#212">212</a> <em class="jxr_javadoccomment">     * @return a Set of Strings of language names that are potential matches for the input word</em>
+<a class="jxr_linenumber" name="213" href="#213">213</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="214" href="#214">214</a>     <strong class="jxr_keyword">public</strong> Languages.LanguageSet guessLanguages(<strong class="jxr_keyword">final</strong> String input) {
+<a class="jxr_linenumber" name="215" href="#215">215</a>         <strong class="jxr_keyword">final</strong> String text = input.toLowerCase(Locale.ENGLISH);
+<a class="jxr_linenumber" name="216" href="#216">216</a> 
+<a class="jxr_linenumber" name="217" href="#217">217</a>         <strong class="jxr_keyword">final</strong> Set&lt;String&gt; langs = <strong class="jxr_keyword">new</strong> HashSet&lt;String&gt;(<strong class="jxr_keyword">this</strong>.languages.getLanguages());
+<a class="jxr_linenumber" name="218" href="#218">218</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">final</strong> LangRule rule : <strong class="jxr_keyword">this</strong>.rules) {
+<a class="jxr_linenumber" name="219" href="#219">219</a>             <strong class="jxr_keyword">if</strong> (rule.matches(text)) {
+<a class="jxr_linenumber" name="220" href="#220">220</a>                 <strong class="jxr_keyword">if</strong> (rule.acceptOnMatch) {
+<a class="jxr_linenumber" name="221" href="#221">221</a>                     langs.retainAll(rule.languages);
+<a class="jxr_linenumber" name="222" href="#222">222</a>                 } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="223" href="#223">223</a>                     langs.removeAll(rule.languages);
+<a class="jxr_linenumber" name="224" href="#224">224</a>                 }
+<a class="jxr_linenumber" name="225" href="#225">225</a>             }
+<a class="jxr_linenumber" name="226" href="#226">226</a>         }
+<a class="jxr_linenumber" name="227" href="#227">227</a> 
+<a class="jxr_linenumber" name="228" href="#228">228</a>         <strong class="jxr_keyword">final</strong> Languages.LanguageSet ls = Languages.LanguageSet.from(langs);
+<a class="jxr_linenumber" name="229" href="#229">229</a>         <strong class="jxr_keyword">return</strong> ls.equals(Languages.NO_LANGUAGES) ? Languages.ANY_LANGUAGE : ls;
+<a class="jxr_linenumber" name="230" href="#230">230</a>     }
+<a class="jxr_linenumber" name="231" href="#231">231</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>

Modified: websites/production/commons/content/proper/commons-codec/xref/org/apache/commons/codec/language/bm/Languages.html
==============================================================================
--- websites/production/commons/content/proper/commons-codec/xref/org/apache/commons/codec/language/bm/Languages.html (original)
+++ websites/production/commons/content/proper/commons-codec/xref/org/apache/commons/codec/language/bm/Languages.html Wed Dec 11 04:34:40 2013
@@ -58,7 +58,7 @@
 <a class="jxr_linenumber" name="48" href="#48">48</a>  <em class="jxr_javadoccomment"> * This class is immutable and thread-safe.</em>
 <a class="jxr_linenumber" name="49" href="#49">49</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="50" href="#50">50</a>  <em class="jxr_javadoccomment"> * @since 1.6</em>
-<a class="jxr_linenumber" name="51" href="#51">51</a>  <em class="jxr_javadoccomment"> * @version $Id: Languages.java 1429868 2013-01-07 16:08:05Z ggregory $</em>
+<a class="jxr_linenumber" name="51" href="#51">51</a>  <em class="jxr_javadoccomment"> * @version $Id: Languages.java 1541239 2013-11-12 21:20:05Z ggregory $</em>
 <a class="jxr_linenumber" name="52" href="#52">52</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="53" href="#53">53</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a> {
 <a class="jxr_linenumber" name="54" href="#54">54</a>      <em class="jxr_comment">// Iimplementation note: This class is divided into two sections. The first part is a static factory interface that</em>
@@ -127,13 +127,13 @@
 <a class="jxr_linenumber" name="117" href="#117">117</a>                 <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>;
 <a class="jxr_linenumber" name="118" href="#118">118</a>             } <strong class="jxr_keyword">else</strong> {
 <a class="jxr_linenumber" name="119" href="#119">119</a>                 <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">SomeLanguages</a> sl = (SomeLanguages) other;
-<a class="jxr_linenumber" name="120" href="#120">120</a>                 <strong class="jxr_keyword">if</strong> (sl.languages.containsAll(languages)) {
-<a class="jxr_linenumber" name="121" href="#121">121</a>                     <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>;
-<a class="jxr_linenumber" name="122" href="#122">122</a>                 } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="123" href="#123">123</a>                     <strong class="jxr_keyword">final</strong> Set&lt;String&gt; ls = <strong class="jxr_keyword">new</strong> HashSet&lt;String&gt;(<strong class="jxr_keyword">this</strong>.languages);
-<a class="jxr_linenumber" name="124" href="#124">124</a>                     ls.retainAll(sl.languages);
-<a class="jxr_linenumber" name="125" href="#125">125</a>                     <strong class="jxr_keyword">return</strong> from(ls);
-<a class="jxr_linenumber" name="126" href="#126">126</a>                 }
+<a class="jxr_linenumber" name="120" href="#120">120</a>                 <strong class="jxr_keyword">final</strong> Set&lt;String&gt; ls = <strong class="jxr_keyword">new</strong> HashSet&lt;String&gt;(Math.min(languages.size(), sl.languages.size()));
+<a class="jxr_linenumber" name="121" href="#121">121</a>                 <strong class="jxr_keyword">for</strong> (String lang : languages) {
+<a class="jxr_linenumber" name="122" href="#122">122</a>                     <strong class="jxr_keyword">if</strong> (sl.languages.contains(lang)) {
+<a class="jxr_linenumber" name="123" href="#123">123</a>                         ls.add(lang);
+<a class="jxr_linenumber" name="124" href="#124">124</a>                     }
+<a class="jxr_linenumber" name="125" href="#125">125</a>                 }
+<a class="jxr_linenumber" name="126" href="#126">126</a>                 <strong class="jxr_keyword">return</strong> from(ls);
 <a class="jxr_linenumber" name="127" href="#127">127</a>             }
 <a class="jxr_linenumber" name="128" href="#128">128</a>         }
 <a class="jxr_linenumber" name="129" href="#129">129</a> 
@@ -168,109 +168,113 @@
 <a class="jxr_linenumber" name="158" href="#158">158</a>         }
 <a class="jxr_linenumber" name="159" href="#159">159</a> 
 <a class="jxr_linenumber" name="160" href="#160">160</a>         <strong class="jxr_keyword">final</strong> Scanner lsScanner = <strong class="jxr_keyword">new</strong> Scanner(langIS, ResourceConstants.ENCODING);
-<a class="jxr_linenumber" name="161" href="#161">161</a>         <strong class="jxr_keyword">boolean</strong> inExtendedComment = false;
-<a class="jxr_linenumber" name="162" href="#162">162</a>         <strong class="jxr_keyword">while</strong> (lsScanner.hasNextLine()) {
-<a class="jxr_linenumber" name="163" href="#163">163</a>             <strong class="jxr_keyword">final</strong> String line = lsScanner.nextLine().trim();
-<a class="jxr_linenumber" name="164" href="#164">164</a>             <strong class="jxr_keyword">if</strong> (inExtendedComment) {
-<a class="jxr_linenumber" name="165" href="#165">165</a>                 <strong class="jxr_keyword">if</strong> (line.endsWith(ResourceConstants.EXT_CMT_END)) {
-<a class="jxr_linenumber" name="166" href="#166">166</a>                     inExtendedComment = false;
-<a class="jxr_linenumber" name="167" href="#167">167</a>                 }
-<a class="jxr_linenumber" name="168" href="#168">168</a>             } <strong class="jxr_keyword">else</strong> {
-<a class="jxr_linenumber" name="169" href="#169">169</a>                 <strong class="jxr_keyword">if</strong> (line.startsWith(ResourceConstants.EXT_CMT_START)) {
-<a class="jxr_linenumber" name="170" href="#170">170</a>                     inExtendedComment = <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="171" href="#171">171</a>                 } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (line.length() &gt; 0) {
-<a class="jxr_linenumber" name="172" href="#172">172</a>                     ls.add(line);
-<a class="jxr_linenumber" name="173" href="#173">173</a>                 }
-<a class="jxr_linenumber" name="174" href="#174">174</a>             }
-<a class="jxr_linenumber" name="175" href="#175">175</a>         }
-<a class="jxr_linenumber" name="176" href="#176">176</a> 
-<a class="jxr_linenumber" name="177" href="#177">177</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a>(Collections.unmodifiableSet(ls));
-<a class="jxr_linenumber" name="178" href="#178">178</a>     }
-<a class="jxr_linenumber" name="179" href="#179">179</a> 
-<a class="jxr_linenumber" name="180" href="#180">180</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> String langResourceName(<strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/NameType.html">NameType</a> nameType) {
-<a class="jxr_linenumber" name="181" href="#181">181</a>         <strong class="jxr_keyword">return</strong> String.format(<span class="jxr_string">"org/apache/commons/codec/language/bm/%s_languages.txt"</span>, nameType.getName());
+<a class="jxr_linenumber" name="161" href="#161">161</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="162" href="#162">162</a>             <strong class="jxr_keyword">boolean</strong> inExtendedComment = false;
+<a class="jxr_linenumber" name="163" href="#163">163</a>             <strong class="jxr_keyword">while</strong> (lsScanner.hasNextLine()) {
+<a class="jxr_linenumber" name="164" href="#164">164</a>                 <strong class="jxr_keyword">final</strong> String line = lsScanner.nextLine().trim();
+<a class="jxr_linenumber" name="165" href="#165">165</a>                 <strong class="jxr_keyword">if</strong> (inExtendedComment) {
+<a class="jxr_linenumber" name="166" href="#166">166</a>                     <strong class="jxr_keyword">if</strong> (line.endsWith(ResourceConstants.EXT_CMT_END)) {
+<a class="jxr_linenumber" name="167" href="#167">167</a>                         inExtendedComment = false;
+<a class="jxr_linenumber" name="168" href="#168">168</a>                     }
+<a class="jxr_linenumber" name="169" href="#169">169</a>                 } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="170" href="#170">170</a>                     <strong class="jxr_keyword">if</strong> (line.startsWith(ResourceConstants.EXT_CMT_START)) {
+<a class="jxr_linenumber" name="171" href="#171">171</a>                         inExtendedComment = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="172" href="#172">172</a>                     } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (line.length() &gt; 0) {
+<a class="jxr_linenumber" name="173" href="#173">173</a>                         ls.add(line);
+<a class="jxr_linenumber" name="174" href="#174">174</a>                     }
+<a class="jxr_linenumber" name="175" href="#175">175</a>                 }
+<a class="jxr_linenumber" name="176" href="#176">176</a>             }
+<a class="jxr_linenumber" name="177" href="#177">177</a>         } <strong class="jxr_keyword">finally</strong> {
+<a class="jxr_linenumber" name="178" href="#178">178</a>             lsScanner.close();
+<a class="jxr_linenumber" name="179" href="#179">179</a>         }
+<a class="jxr_linenumber" name="180" href="#180">180</a> 
+<a class="jxr_linenumber" name="181" href="#181">181</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a>(Collections.unmodifiableSet(ls));
 <a class="jxr_linenumber" name="182" href="#182">182</a>     }
 <a class="jxr_linenumber" name="183" href="#183">183</a> 
-<a class="jxr_linenumber" name="184" href="#184">184</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> Set&lt;String&gt; languages;
-<a class="jxr_linenumber" name="185" href="#185">185</a> 
-<a class="jxr_linenumber" name="186" href="#186">186</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="187" href="#187">187</a> <em class="jxr_javadoccomment">     * No languages at all.</em>
-<a class="jxr_linenumber" name="188" href="#188">188</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="189" href="#189">189</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> NO_LANGUAGES = <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a>() {
-<a class="jxr_linenumber" name="190" href="#190">190</a>         @Override
-<a class="jxr_linenumber" name="191" href="#191">191</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> String language) {
-<a class="jxr_linenumber" name="192" href="#192">192</a>             <strong class="jxr_keyword">return</strong> false;
-<a class="jxr_linenumber" name="193" href="#193">193</a>         }
-<a class="jxr_linenumber" name="194" href="#194">194</a> 
-<a class="jxr_linenumber" name="195" href="#195">195</a>         @Override
-<a class="jxr_linenumber" name="196" href="#196">196</a>         <strong class="jxr_keyword">public</strong> String getAny() {
-<a class="jxr_linenumber" name="197" href="#197">197</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> NoSuchElementException(<span class="jxr_string">"Can't fetch any language from the empty language set."</span>);
-<a class="jxr_linenumber" name="198" href="#198">198</a>         }
-<a class="jxr_linenumber" name="199" href="#199">199</a> 
-<a class="jxr_linenumber" name="200" href="#200">200</a>         @Override
-<a class="jxr_linenumber" name="201" href="#201">201</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isEmpty() {
-<a class="jxr_linenumber" name="202" href="#202">202</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="203" href="#203">203</a>         }
-<a class="jxr_linenumber" name="204" href="#204">204</a> 
-<a class="jxr_linenumber" name="205" href="#205">205</a>         @Override
-<a class="jxr_linenumber" name="206" href="#206">206</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSingleton() {
-<a class="jxr_linenumber" name="207" href="#207">207</a>             <strong class="jxr_keyword">return</strong> false;
-<a class="jxr_linenumber" name="208" href="#208">208</a>         }
-<a class="jxr_linenumber" name="209" href="#209">209</a> 
-<a class="jxr_linenumber" name="210" href="#210">210</a>         @Override
-<a class="jxr_linenumber" name="211" href="#211">211</a>         <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> restrictTo(<strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> other) {
-<a class="jxr_linenumber" name="212" href="#212">212</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>;
-<a class="jxr_linenumber" name="213" href="#213">213</a>         }
-<a class="jxr_linenumber" name="214" href="#214">214</a> 
-<a class="jxr_linenumber" name="215" href="#215">215</a>         @Override
-<a class="jxr_linenumber" name="216" href="#216">216</a>         <strong class="jxr_keyword">public</strong> String toString() {
-<a class="jxr_linenumber" name="217" href="#217">217</a>             <strong class="jxr_keyword">return</strong> <span class="jxr_string">"NO_LANGUAGES"</span>;
-<a class="jxr_linenumber" name="218" href="#218">218</a>         }
-<a class="jxr_linenumber" name="219" href="#219">219</a>     };
-<a class="jxr_linenumber" name="220" href="#220">220</a> 
-<a class="jxr_linenumber" name="221" href="#221">221</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="222" href="#222">222</a> <em class="jxr_javadoccomment">     * Any/all languages.</em>
-<a class="jxr_linenumber" name="223" href="#223">223</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="224" href="#224">224</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> ANY_LANGUAGE = <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a>() {
-<a class="jxr_linenumber" name="225" href="#225">225</a>         @Override
-<a class="jxr_linenumber" name="226" href="#226">226</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> String language) {
-<a class="jxr_linenumber" name="227" href="#227">227</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="228" href="#228">228</a>         }
-<a class="jxr_linenumber" name="229" href="#229">229</a> 
-<a class="jxr_linenumber" name="230" href="#230">230</a>         @Override
-<a class="jxr_linenumber" name="231" href="#231">231</a>         <strong class="jxr_keyword">public</strong> String getAny() {
-<a class="jxr_linenumber" name="232" href="#232">232</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> NoSuchElementException(<span class="jxr_string">"Can't fetch any language from the any language set."</span>);
-<a class="jxr_linenumber" name="233" href="#233">233</a>         }
-<a class="jxr_linenumber" name="234" href="#234">234</a> 
-<a class="jxr_linenumber" name="235" href="#235">235</a>         @Override
-<a class="jxr_linenumber" name="236" href="#236">236</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isEmpty() {
-<a class="jxr_linenumber" name="237" href="#237">237</a>             <strong class="jxr_keyword">return</strong> false;
-<a class="jxr_linenumber" name="238" href="#238">238</a>         }
-<a class="jxr_linenumber" name="239" href="#239">239</a> 
-<a class="jxr_linenumber" name="240" href="#240">240</a>         @Override
-<a class="jxr_linenumber" name="241" href="#241">241</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSingleton() {
-<a class="jxr_linenumber" name="242" href="#242">242</a>             <strong class="jxr_keyword">return</strong> false;
-<a class="jxr_linenumber" name="243" href="#243">243</a>         }
-<a class="jxr_linenumber" name="244" href="#244">244</a> 
-<a class="jxr_linenumber" name="245" href="#245">245</a>         @Override
-<a class="jxr_linenumber" name="246" href="#246">246</a>         <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> restrictTo(<strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> other) {
-<a class="jxr_linenumber" name="247" href="#247">247</a>             <strong class="jxr_keyword">return</strong> other;
-<a class="jxr_linenumber" name="248" href="#248">248</a>         }
-<a class="jxr_linenumber" name="249" href="#249">249</a> 
-<a class="jxr_linenumber" name="250" href="#250">250</a>         @Override
-<a class="jxr_linenumber" name="251" href="#251">251</a>         <strong class="jxr_keyword">public</strong> String toString() {
-<a class="jxr_linenumber" name="252" href="#252">252</a>             <strong class="jxr_keyword">return</strong> <span class="jxr_string">"ANY_LANGUAGE"</span>;
-<a class="jxr_linenumber" name="253" href="#253">253</a>         }
-<a class="jxr_linenumber" name="254" href="#254">254</a>     };
-<a class="jxr_linenumber" name="255" href="#255">255</a> 
-<a class="jxr_linenumber" name="256" href="#256">256</a>     <strong class="jxr_keyword">private</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a>(<strong class="jxr_keyword">final</strong> Set&lt;String&gt; languages) {
-<a class="jxr_linenumber" name="257" href="#257">257</a>         <strong class="jxr_keyword">this</strong>.languages = languages;
-<a class="jxr_linenumber" name="258" href="#258">258</a>     }
+<a class="jxr_linenumber" name="184" href="#184">184</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> String langResourceName(<strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/NameType.html">NameType</a> nameType) {
+<a class="jxr_linenumber" name="185" href="#185">185</a>         <strong class="jxr_keyword">return</strong> String.format(<span class="jxr_string">"org/apache/commons/codec/language/bm/%s_languages.txt"</span>, nameType.getName());
+<a class="jxr_linenumber" name="186" href="#186">186</a>     }
+<a class="jxr_linenumber" name="187" href="#187">187</a> 
+<a class="jxr_linenumber" name="188" href="#188">188</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> Set&lt;String&gt; languages;
+<a class="jxr_linenumber" name="189" href="#189">189</a> 
+<a class="jxr_linenumber" name="190" href="#190">190</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="191" href="#191">191</a> <em class="jxr_javadoccomment">     * No languages at all.</em>
+<a class="jxr_linenumber" name="192" href="#192">192</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="193" href="#193">193</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> NO_LANGUAGES = <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a>() {
+<a class="jxr_linenumber" name="194" href="#194">194</a>         @Override
+<a class="jxr_linenumber" name="195" href="#195">195</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> String language) {
+<a class="jxr_linenumber" name="196" href="#196">196</a>             <strong class="jxr_keyword">return</strong> false;
+<a class="jxr_linenumber" name="197" href="#197">197</a>         }
+<a class="jxr_linenumber" name="198" href="#198">198</a> 
+<a class="jxr_linenumber" name="199" href="#199">199</a>         @Override
+<a class="jxr_linenumber" name="200" href="#200">200</a>         <strong class="jxr_keyword">public</strong> String getAny() {
+<a class="jxr_linenumber" name="201" href="#201">201</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> NoSuchElementException(<span class="jxr_string">"Can't fetch any language from the empty language set."</span>);
+<a class="jxr_linenumber" name="202" href="#202">202</a>         }
+<a class="jxr_linenumber" name="203" href="#203">203</a> 
+<a class="jxr_linenumber" name="204" href="#204">204</a>         @Override
+<a class="jxr_linenumber" name="205" href="#205">205</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isEmpty() {
+<a class="jxr_linenumber" name="206" href="#206">206</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="207" href="#207">207</a>         }
+<a class="jxr_linenumber" name="208" href="#208">208</a> 
+<a class="jxr_linenumber" name="209" href="#209">209</a>         @Override
+<a class="jxr_linenumber" name="210" href="#210">210</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSingleton() {
+<a class="jxr_linenumber" name="211" href="#211">211</a>             <strong class="jxr_keyword">return</strong> false;
+<a class="jxr_linenumber" name="212" href="#212">212</a>         }
+<a class="jxr_linenumber" name="213" href="#213">213</a> 
+<a class="jxr_linenumber" name="214" href="#214">214</a>         @Override
+<a class="jxr_linenumber" name="215" href="#215">215</a>         <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> restrictTo(<strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> other) {
+<a class="jxr_linenumber" name="216" href="#216">216</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>;
+<a class="jxr_linenumber" name="217" href="#217">217</a>         }
+<a class="jxr_linenumber" name="218" href="#218">218</a> 
+<a class="jxr_linenumber" name="219" href="#219">219</a>         @Override
+<a class="jxr_linenumber" name="220" href="#220">220</a>         <strong class="jxr_keyword">public</strong> String toString() {
+<a class="jxr_linenumber" name="221" href="#221">221</a>             <strong class="jxr_keyword">return</strong> <span class="jxr_string">"NO_LANGUAGES"</span>;
+<a class="jxr_linenumber" name="222" href="#222">222</a>         }
+<a class="jxr_linenumber" name="223" href="#223">223</a>     };
+<a class="jxr_linenumber" name="224" href="#224">224</a> 
+<a class="jxr_linenumber" name="225" href="#225">225</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="226" href="#226">226</a> <em class="jxr_javadoccomment">     * Any/all languages.</em>
+<a class="jxr_linenumber" name="227" href="#227">227</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="228" href="#228">228</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> ANY_LANGUAGE = <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a>() {
+<a class="jxr_linenumber" name="229" href="#229">229</a>         @Override
+<a class="jxr_linenumber" name="230" href="#230">230</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> String language) {
+<a class="jxr_linenumber" name="231" href="#231">231</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="232" href="#232">232</a>         }
+<a class="jxr_linenumber" name="233" href="#233">233</a> 
+<a class="jxr_linenumber" name="234" href="#234">234</a>         @Override
+<a class="jxr_linenumber" name="235" href="#235">235</a>         <strong class="jxr_keyword">public</strong> String getAny() {
+<a class="jxr_linenumber" name="236" href="#236">236</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> NoSuchElementException(<span class="jxr_string">"Can't fetch any language from the any language set."</span>);
+<a class="jxr_linenumber" name="237" href="#237">237</a>         }
+<a class="jxr_linenumber" name="238" href="#238">238</a> 
+<a class="jxr_linenumber" name="239" href="#239">239</a>         @Override
+<a class="jxr_linenumber" name="240" href="#240">240</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isEmpty() {
+<a class="jxr_linenumber" name="241" href="#241">241</a>             <strong class="jxr_keyword">return</strong> false;
+<a class="jxr_linenumber" name="242" href="#242">242</a>         }
+<a class="jxr_linenumber" name="243" href="#243">243</a> 
+<a class="jxr_linenumber" name="244" href="#244">244</a>         @Override
+<a class="jxr_linenumber" name="245" href="#245">245</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> isSingleton() {
+<a class="jxr_linenumber" name="246" href="#246">246</a>             <strong class="jxr_keyword">return</strong> false;
+<a class="jxr_linenumber" name="247" href="#247">247</a>         }
+<a class="jxr_linenumber" name="248" href="#248">248</a> 
+<a class="jxr_linenumber" name="249" href="#249">249</a>         @Override
+<a class="jxr_linenumber" name="250" href="#250">250</a>         <strong class="jxr_keyword">public</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> restrictTo(<strong class="jxr_keyword">final</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">LanguageSet</a> other) {
+<a class="jxr_linenumber" name="251" href="#251">251</a>             <strong class="jxr_keyword">return</strong> other;
+<a class="jxr_linenumber" name="252" href="#252">252</a>         }
+<a class="jxr_linenumber" name="253" href="#253">253</a> 
+<a class="jxr_linenumber" name="254" href="#254">254</a>         @Override
+<a class="jxr_linenumber" name="255" href="#255">255</a>         <strong class="jxr_keyword">public</strong> String toString() {
+<a class="jxr_linenumber" name="256" href="#256">256</a>             <strong class="jxr_keyword">return</strong> <span class="jxr_string">"ANY_LANGUAGE"</span>;
+<a class="jxr_linenumber" name="257" href="#257">257</a>         }
+<a class="jxr_linenumber" name="258" href="#258">258</a>     };
 <a class="jxr_linenumber" name="259" href="#259">259</a> 
-<a class="jxr_linenumber" name="260" href="#260">260</a>     <strong class="jxr_keyword">public</strong> Set&lt;String&gt; getLanguages() {
-<a class="jxr_linenumber" name="261" href="#261">261</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>.languages;
+<a class="jxr_linenumber" name="260" href="#260">260</a>     <strong class="jxr_keyword">private</strong> <a href="../../../../../../org/apache/commons/codec/language/bm/Languages.html">Languages</a>(<strong class="jxr_keyword">final</strong> Set&lt;String&gt; languages) {
+<a class="jxr_linenumber" name="261" href="#261">261</a>         <strong class="jxr_keyword">this</strong>.languages = languages;
 <a class="jxr_linenumber" name="262" href="#262">262</a>     }
-<a class="jxr_linenumber" name="263" href="#263">263</a> }
+<a class="jxr_linenumber" name="263" href="#263">263</a> 
+<a class="jxr_linenumber" name="264" href="#264">264</a>     <strong class="jxr_keyword">public</strong> Set&lt;String&gt; getLanguages() {
+<a class="jxr_linenumber" name="265" href="#265">265</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">this</strong>.languages;
+<a class="jxr_linenumber" name="266" href="#266">266</a>     }
+<a class="jxr_linenumber" name="267" href="#267">267</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>



Mime
View raw message