Java Doc for StringUtils.java in  » Content-Management-System » hippo-cms » nl » hippo » cms » spellchecking » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » hippo cms » nl.hippo.cms.spellchecking 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   nl.hippo.cms.spellchecking.StringUtils

StringUtils
public class StringUtils (Code)
A collection of String handling utility methods.

Some of the methods available in this class have equivalents in the java.lang.String class. However, the implementations provided here are a lot faster, since they do not deal with character internationalization issues.


author:
   Bruno Martins





Method Summary
public static  Stringcapitalizate(String str)
     Capitalizates a given String.
Parameters:
  str - A String.
public static  Stringcapitalizate(String str, boolean accents)
     Capitalizates a given String.
Parameters:
  str - A String.
public static  Stringcapitalizate(String str, boolean accents, boolean abbreviations)
     Trims and capitalizates a given String, with specific rules for Portuguese words.
Parameters:
  str - A String.
public static  intcount(String str, char c)
     Counts the occurrence of the given char in a String.
Parameters:
  str - The string to be tested.
Parameters:
  c - the char to be counted.
public static  StringUtilsgetInstance()
     Return the single instance of this class.
public static  char[]getSpecialChars()
     Return an array with all the valid accented characters.
public static  StringinvertString(String s)
     Reverse a given String.
Parameters:
  s - The String to reverse.
public static  booleanisAccent(char chr)
     Checks if a given character has diacritics.
public static  booleanisAlphaNumeric(char c)
     Tests whether a given character is alphabetic, numeric or the hyphen character.
Parameters:
  c - The character to be tested.
public static  booleanisCapitalizated(String str)
     Checks if a given String is capitalizated.
Parameters:
  str - A String.
public static  booleanisUpperCase(char chr)
     Checks if a given character is uppercase.
final public static  booleanisVowel(String in, int at)
     Checks if the character at a given position of a given string is a vowel. The Y character is also considered. TODO: Should portuguese accented characters be considered vowels?
Parameters:
  in - A String.
Parameters:
  at - The position in the String.
public static  booleanisVowel(String in, int at, int length)
     Checks if the character at a given position of a given string is a vowel The Y character is also considered. TODO: Should portuguese accented characters be considered vowels?
Parameters:
  in - A String.
Parameters:
  at - The position in the String.
Parameters:
  length - The maximum lengh of the String to check.
public static  intmatchStrings(String a, String b)
     Matches two strings.
Parameters:
  a - The first string.
Parameters:
  b - The second string.
public static  Stringreplace(String source, String search, String replace)
     Returns a new string resulting from replacing all occurrences of the String search in the String source, with the string replace.
public static  charreplaceAccent(char chr)
     Replaces accented characters with their variations without the diacritics. TODO: add more non-Portuguese diacritic characters.
public static  StringseparateNumberWithDots(String n)
     Takes a numeric string and separates groups of 3 characters with a '.' character.
public static  StringseparateNumberWithDots(String n, int s)
     Takes a numeric string and separates groups of "n" characters with a '.' character.
public static  StringtoLowerCase(String str, boolean accents)
     Converts all of the characters in a given String to lower case.



Method Detail
capitalizate
public static String capitalizate(String str)(Code)
Capitalizates a given String.
Parameters:
  str - A String. The capitalizated String.



capitalizate
public static String capitalizate(String str, boolean accents)(Code)
Capitalizates a given String.
Parameters:
  str - A String. The capitalizated String.



capitalizate
public static String capitalizate(String str, boolean accents, boolean abbreviations)(Code)
Trims and capitalizates a given String, with specific rules for Portuguese words.
Parameters:
  str - A String. The capitalizated String.



count
public static int count(String str, char c)(Code)
Counts the occurrence of the given char in a String.
Parameters:
  str - The string to be tested.
Parameters:
  c - the char to be counted. the frequency of occurrence for the character in the String.



getInstance
public static StringUtils getInstance()(Code)
Return the single instance of this class. An instance of StringUtils.



getSpecialChars
public static char[] getSpecialChars()(Code)
Return an array with all the valid accented characters. TODO: add more non-Portuguese diacritic characters. An array with all the valid accented characters.



invertString
public static String invertString(String s)(Code)
Reverse a given String.
Parameters:
  s - The String to reverse. The reversed string.



isAccent
public static boolean isAccent(char chr)(Code)
Checks if a given character has diacritics. For instance, isAccent('a') would return false, whereas isAccent('รก') would return true.
Parameters:
  chr - the char to check. true if the character has a diacritic and false otherwise.



isAlphaNumeric
public static boolean isAlphaNumeric(char c)(Code)
Tests whether a given character is alphabetic, numeric or the hyphen character.
Parameters:
  c - The character to be tested. whether the given character is alphameric or not.



isCapitalizated
public static boolean isCapitalizated(String str)(Code)
Checks if a given String is capitalizated.
Parameters:
  str - A String. true if the given String is capitalizated and false otherwise.



isUpperCase
public static boolean isUpperCase(char chr)(Code)
Checks if a given character is uppercase. For instance, isUpperCase('a') would return false, whereas isUpperCase('A') would return true.
Parameters:
  chr - the char to check. true if the character is uppercase and false otherwise.



isVowel
final public static boolean isVowel(String in, int at)(Code)
Checks if the character at a given position of a given string is a vowel. The Y character is also considered. TODO: Should portuguese accented characters be considered vowels?
Parameters:
  in - A String.
Parameters:
  at - The position in the String. true if the the character at position at of the string in is a voweland false otherwise.



isVowel
public static boolean isVowel(String in, int at, int length)(Code)
Checks if the character at a given position of a given string is a vowel The Y character is also considered. TODO: Should portuguese accented characters be considered vowels?
Parameters:
  in - A String.
Parameters:
  at - The position in the String.
Parameters:
  length - The maximum lengh of the String to check. true if the the character at position at of the string in is a voweland false otherwise.



matchStrings
public static int matchStrings(String a, String b)(Code)
Matches two strings.
Parameters:
  a - The first string.
Parameters:
  b - The second string. the index where the two strings stop matching starting from 0.



replace
public static String replace(String source, String search, String replace)(Code)
Returns a new string resulting from replacing all occurrences of the String search in the String source, with the string replace.
Parameters:
  source - The original String.
Parameters:
  search - The string to be replaces.
Parameters:
  replace - The replacement String. The resulting String.



replaceAccent
public static char replaceAccent(char chr)(Code)
Replaces accented characters with their variations without the diacritics. TODO: add more non-Portuguese diacritic characters.
Parameters:
  chr - the character to check. The character without the diacritic.



separateNumberWithDots
public static String separateNumberWithDots(String n)(Code)
Takes a numeric string and separates groups of 3 characters with a '.' character. For instance separateNumberWithDots(n) would return "1.000".
Parameters:
  n - A numeric String. The resulting String.



separateNumberWithDots
public static String separateNumberWithDots(String n, int s)(Code)
Takes a numeric string and separates groups of "n" characters with a '.' character. For instance separateNumberWithDots(n,3) would return "1.000"
Parameters:
  n - A numeric String.
Parameters:
  s - The number of characters to group. The resulting String.



toLowerCase
public static String toLowerCase(String str, boolean accents)(Code)
Converts all of the characters in a given String to lower case.
Parameters:
  str - A String.
Parameters:
  accents - if true, then besides converting the string to lower caseaccented characters are also replaces with their versions without the diacritics. The resulting String.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.