frontpage, click here to enter!


frontpage

frontpage resources brought to you by aldenhosting.com

frontpage

frontpage information is available by clicking above

Since 1998, Alden Hosting is a provider of business-class Web hosting to small- and medium-sized businesses, providing professional, efficient, and reliable services. We provide everything you need to get your business on the Internet. We make it easy and affordable. Alden Hosting's feature-rich hosting plans and excellent 7 days a week toll-free customer support empower you to efficiently build a Web business that will grow with your changing needs.

Site Map
frontpage frontpage The program starts by defining collation rules for English and Spanish. The program will sort the Spanish words in the traditional manner. When sorting by the traditional rules, the letters ch and ll and their uppercase equivalents each have their own positions in the sort order. These character pairs compare as if they were one character. For example, ch sorts as a single letter, following cz in the sort order.

frontpage Note how the rules for the two collators differ: String englishRules = ("< a,A < b,B < c,C < d,D < e,E < f,F " + "< g,G < h,H < i,I < j,J < k,K < l,L " + "< m,M < n,N < o,O < p,P < q,Q < r,R " + "< s,S < t,T < u,U < v,V < w,W < x,X " + "< y,Y < z,Z"); String smallnTilde = new String("\u00F1"); // ñ String capitalNTilde = new String("\u00D1"); // Ñ String traditionalSpanishRules = ("< a,A < b,B < c,C " + "< ch, cH, Ch, CH " + "< d,D < e,E < f,F " + "< g,G < h,H < i,I < j,J < k,K < l,L " + "< ll, lL, Ll, LL " + "< m,M < n,N " + "< " + smallnTilde + "," + capitalNTilde + " " + "< o,O < p,P < q,Q < r,R " + "< s,S < t,T < u,U < v,V < w,W < x,X " + "< y,Y < z,Z"); The following lines of code create the collators and invoke the sort routine: try { RuleBasedCollator enCollator = new RuleBasedCollator(englishRules); RuleBasedCollator spCollator = new RuleBasedCollator(traditionalSpanishRules); sortStrings(enCollator, words); printStrings(words); System.out.println(); sortStrings(spCollator, words); printStrings(words); } catch (ParseException pe) { System.out.println("Parse exception for rules"); } The sort routine, called , is generic.

frontpage It will sort any array of words according to the rules of any object: public static void sortStrings(Collator collator, String[] words) { String tmp; for (int i = 0; i < words.length; i++) { for (int j = i + 1; j < words.length; j++) { if (collator.compare(words[i], words[j]) > 0) { tmp = words[i]; words[i] = words[j]; words[j] = tmp; } } } } When sorted with the English collation rules, the array of words is as follows: chalina curioso llama luz Compare the preceding list with the following, which is sorted according to the traditional Spanish rules of collation: curioso chalina luz llama • • the Examples: FAQs. us your feedback.

frontpage

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  Web Hosting Links Portal
Web Hosting JSP Hosting Tomcat Hosting MySQL Hosting servlets Hosting
Web Site Hosting JSP Hosting Tomcat Hosting MySQL Hosting servlets Hosting
Web Site Hosting JSP Hosting Tomcat Hosting MySQL Hosting servlets Hosting
Web Site Hosting JSP Hosting Tomcat Hosting MySQL Hosting servlets Hosting
JSP Web Hosting JSP Web Hosting
Servlet Web Hosting Servlet Web Hosting
College Coach Deb Links College Coach Deb College Coach Deb Portal

frontpage