Java Doc for StringUtils.java in  » UML » MetaBoss » com » metaboss » util » 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 » UML » MetaBoss » com.metaboss.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.metaboss.util.StringUtils

StringUtils
public class StringUtils (Code)
Set of useful utilites to do with string manipulations




Method Summary
public static  Stringcombine(String[] pSource, String pFiller)
    
public static  Stringcombine(String[] pSource, String pFiller, int beginIndex, int endIndex)
     Combine specified number of elements into the string using specified token separator.
public static  intcountDigits(String in)
    
public static  intcountLetters(String in)
    
public static  Stringfill(String pToken, String pPrefix, String pSuffix, String pSeparator, int pTokenRepeatCount)
    
public static  StringgetIndent(int lStepSize, int lRequiredNumberOfSteps)
     Returns string with certain number of spaces.
Parameters:
  lStepSize - - the size of each step in indentation (e.g.
public static  StringgetToken(String str, String delim, int count)
    
public static  booleanisBlank(String str)
    
public static  StringleftJustify(int fieldWidth, String fieldValue, String fillerElement)
     Returns string with value left justified, padded with spaces.
public static  StringreadTextStreamFully(InputStream str)
    
public static  Stringreplace(String pInput, char pFind, String pReplace)
    
public static  Stringreplace(String pInput, String pFind, String pReplace)
    
public static  StringrightJustify(int fieldWidth, String fieldValue, String fillerElement)
     Returns string with value right justified, padded with spaces.
public static  String[]split(String val, String split)
     Split a string into tokens.
public static  StringsuggestConstantIdentifier(String pText)
     This utility analyses given text and suggests derived name, which can be used as java constant identifier (e.g.
public static  StringsuggestJavaIdentifier(String pText)
    
public static  StringsuggestJavaStringConstant(String pString)
     Returns string which can be specified as String constant in order to represent given string.
public static  StringsuggestMessageFormatPatternString(String pMessageString)
     This utility analyses given message string and suggests derived string, which should be used as pattern argument in the java.text.MessageFormat.
public static  StringsuggestName(String pText, boolean pCapitaliseFirst, boolean pDecapitaliseOther)
     Shrinks text to one word, which than can be used as a name etc.
public static  StringsuggestTruncatedOutput(String pText, int pRequiredVisibleLength)
     This utility analyses given text and suggests derived string, which is very convenient to output for log.
public static  StringtoLowerCaseFirstCharacter(String pSourceString)
    
public static  StringtoUpperCaseFirstCharacter(String pSourceString)
    



Method Detail
combine
public static String combine(String[] pSource, String pFiller)(Code)
Combine specified number of elements into the single string filling the filler string in between tokens



combine
public static String combine(String[] pSource, String pFiller, int beginIndex, int endIndex)(Code)
Combine specified number of elements into the string using specified token separator. All elements starting from the beginIndex (inclusive) and up to (but not including) the endIndex will be used.
throws:
  ArrayIndexOutOfBoundsException - when specified indexes are out of bounds



countDigits
public static int countDigits(String in)(Code)
Counts digits (Character.isDigit() == true) in the string



countLetters
public static int countLetters(String in)(Code)
Counts letters (Character.isLetter() == true) in the string



fill
public static String fill(String pToken, String pPrefix, String pSuffix, String pSeparator, int pTokenRepeatCount)(Code)
Builds the string consisting of Token string concatenated TokenRepeatCount number of times with specified prefix, suffix and separator strings



getIndent
public static String getIndent(int lStepSize, int lRequiredNumberOfSteps)(Code)
Returns string with certain number of spaces.
Parameters:
  lStepSize - - the size of each step in indentation (e.g. 4 spaces per tab)
Parameters:
  lRequiredNumberOfSteps - - the number of steps required string filled with blanks to required length



getToken
public static String getToken(String str, String delim, int count)(Code)



isBlank
public static boolean isBlank(String str)(Code)



leftJustify
public static String leftJustify(int fieldWidth, String fieldValue, String fillerElement)(Code)
Returns string with value left justified, padded with spaces. If ield value is wider - field value only is returned
Parameters:
  fillerElement - - most often single space, but can be " " for html



readTextStreamFully
public static String readTextStreamFully(InputStream str) throws IOException(Code)



replace
public static String replace(String pInput, char pFind, String pReplace)(Code)
Returns string with every occurrence of the character specified in pFind replaced with the string specified in pReplace



replace
public static String replace(String pInput, String pFind, String pReplace)(Code)
Returns string with every occurrence of the string specified in pFind replaced with the string specified in pReplace



rightJustify
public static String rightJustify(int fieldWidth, String fieldValue, String fillerElement)(Code)
Returns string with value right justified, padded with spaces. If ield value is wider - field value only is returned
Parameters:
  fillerElement - - most often single space, but can be " " for html



split
public static String[] split(String val, String split)(Code)
Split a string into tokens. Note that this predates the split facility available since JDK 1.4. The JDK facility should be used in preference to this



suggestConstantIdentifier
public static String suggestConstantIdentifier(String pText)(Code)
This utility analyses given text and suggests derived name, which can be used as java constant identifier (e.g. Heart Beat Rate becomes HEART_BEAT_RATE). It will ignore all not java identifier characters prepend all upper case characters with '_' (unless there was '_' already) and uppercase them null if it can not suggest anything useful



suggestJavaIdentifier
public static String suggestJavaIdentifier(String pText)(Code)
This utility analyses given text and suggests derived name, which can be used as java identifier it will skip all not java identifier characters and replace all space characters with '_' null if it can not suggest anything useful



suggestJavaStringConstant
public static String suggestJavaStringConstant(String pString)(Code)
Returns string which can be specified as String constant in order to represent given string. Mainly it means that the escape characters '\' are prepended with the other '\' in order for string constant to be correctly interpreted by Java compiler



suggestMessageFormatPatternString
public static String suggestMessageFormatPatternString(String pMessageString)(Code)
This utility analyses given message string and suggests derived string, which should be used as pattern argument in the java.text.MessageFormat. Basically this utility takes care of the string constants and the escape characters.
Parameters:
  pMessageString - - the text for which we need to format using java.text.MessageFormat suggestion String to be used in the pattern in the java.text.MessageFormat class



suggestName
public static String suggestName(String pText, boolean pCapitaliseFirst, boolean pDecapitaliseOther)(Code)
Shrinks text to one word, which than can be used as a name etc. This is achieved by getting rid of whiltespace and optional capitallisation of each first letter and optional decapitalisation of the other letters. For example 'text to name' with as delimiters becomes 'TextToName'



suggestTruncatedOutput
public static String suggestTruncatedOutput(String pText, int pRequiredVisibleLength)(Code)
This utility analyses given text and suggests derived string, which is very convenient to output for log. If given string length is more than required visible length the string is truncated and suffixed with "...(nnnn more)..." suffix. If however actual string is only a little more than required visible length and printing out the whole string will in fact take less space than trunctated string plus suffix - the entire string will be returned
Parameters:
  pText - - the text for which we need to suggest the output
Parameters:
  pRequiredVisibleLength - - the minimum length required to be visible suggestion on how to display the text



toLowerCaseFirstCharacter
public static String toLowerCaseFirstCharacter(String pSourceString)(Code)
Converts string to the same string which starts from the lower case letter



toUpperCaseFirstCharacter
public static String toUpperCaseFirstCharacter(String pSourceString)(Code)
Converts string to the same string which starts from the upper case letter



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.