Java Doc for StringTools.java in  » PDF » jPod » de » intarsys » tools » string » 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 » PDF » jPod » de.intarsys.tools.string 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.intarsys.tools.string.StringTools

StringTools
public class StringTools (Code)
A tool class for the handling of strings.


Field Summary
final public static  StringCR
    
final public static  StringCRLF
    
final public static  StringDATEFORMAT_SIMPLE
    
final public static  StringEMPTY
    
final public static  StringFORMAT_D
    
final public static  StringFORMAT_F
    
final public static  StringFORMAT_I
    
final public static  StringFORMAT_P
    
final public static  StringFORMAT_S
    
final public static  StringLF
    
final public static  StringSPACE
    


Method Summary
public static  Stringformat(Object value, String format)
     Create a string representation and format value according to the instructions in format.
protected static  StringformatDate(Object value, String format)
    
protected static synchronized  StringformatDateDefault(Date date)
    
protected static  StringformatFloat(Object value, String format)
    
protected static  StringformatInteger(Object value, String format)
    
protected static  StringformatPath(Object value, String string)
    
protected static  StringformatString(Object value, String format)
    
public static  StringgetFirstLine(String text)
     The first line of text (all characters up to the first occurence of either "\n" or "\r".
Parameters:
  text - The text where the first line is looked up.
public static  intgetLineCount(String text)
     The number of lines in text.
public static  booleanisEmpty(String value)
     true if value is "empty" in any respect.

This is the case when value == null, value has no characters or only whitespace.
Parameters:
  value - The value to be inspected for emptyness.

public static  String[]parseCommandline(String line)
     Parse a commandline string.
Parameters:
  line - The commandline string.
public static  StringsafeString(Object object)
     Create a string representation of object that is guaranteed not to fail in any case.
Parameters:
  object - The object to be printed.
public static  byte[]toByteArray(String value)
     Create a byte array from the string.
public static  StringtoString(byte[] value)
     Create a string from the byte array.
public static  StringtrimAlphaNumeric(String value)
     Create a string containing only the alphanumeric content of value.
Parameters:
  value - The string to be trimmed.
public static  StringtrimLeft(String value)
     Create a new string from value without leading whitespace.
Parameters:
  value - The string to be stripped.
public static  StringtrimRight(String value)
     Create a new string from value without trailing whitespace.
Parameters:
  value - The string to be stripped.

Field Detail
CR
final public static String CR(Code)



CRLF
final public static String CRLF(Code)



DATEFORMAT_SIMPLE
final public static String DATEFORMAT_SIMPLE(Code)



EMPTY
final public static String EMPTY(Code)
An empty string constant



FORMAT_D
final public static String FORMAT_D(Code)



FORMAT_F
final public static String FORMAT_F(Code)



FORMAT_I
final public static String FORMAT_I(Code)



FORMAT_P
final public static String FORMAT_P(Code)



FORMAT_S
final public static String FORMAT_S(Code)



LF
final public static String LF(Code)



SPACE
final public static String SPACE(Code)
An single space constant





Method Detail
format
public static String format(Object value, String format)(Code)
Create a string representation and format value according to the instructions in format.

If value is null, the empty string is returned.




formatDate
protected static String formatDate(Object value, String format)(Code)



formatDateDefault
protected static synchronized String formatDateDefault(Date date)(Code)

Parameters:
  value -



formatFloat
protected static String formatFloat(Object value, String format)(Code)



formatInteger
protected static String formatInteger(Object value, String format)(Code)



formatPath
protected static String formatPath(Object value, String string)(Code)

Parameters:
  value -
Parameters:
  string -



formatString
protected static String formatString(Object value, String format)(Code)



getFirstLine
public static String getFirstLine(String text)(Code)
The first line of text (all characters up to the first occurence of either "\n" or "\r".
Parameters:
  text - The text where the first line is looked up. The first line of text



getLineCount
public static int getLineCount(String text)(Code)
The number of lines in text. This is 1 + the number of "\n" in text.
Parameters:
  text - The text where the lines are counted. The number of lines in text. This is 1 + thenumber of "\n" in text.



isEmpty
public static boolean isEmpty(String value)(Code)
true if value is "empty" in any respect.

This is the case when value == null, value has no characters or only whitespace.
Parameters:
  value - The value to be inspected for emptyness. true if value is "empty" in anyrespect.




parseCommandline
public static String[] parseCommandline(String line)(Code)
Parse a commandline string.
Parameters:
  line - The commandline string. The array of string tokens in the commandline string.



safeString
public static String safeString(Object object)(Code)
Create a string representation of object that is guaranteed not to fail in any case.
Parameters:
  object - The object to be printed. Create a string representation of object that isguaranteed not to fail in any case.



toByteArray
public static byte[] toByteArray(String value)(Code)
Create a byte array from the string. This is simply a fast version of getBytes, ignoring any encoding.

If you use this, you should be sure you will encounter valid ascii characters only!
Parameters:
  value -




toString
public static String toString(byte[] value)(Code)
Create a string from the byte array. This is simply a fast version of new String(), ignoring any encoding.

If you use this, you should be sure you will encounter valid ascii characters only!
Parameters:
  value -




trimAlphaNumeric
public static String trimAlphaNumeric(String value)(Code)
Create a string containing only the alphanumeric content of value.
Parameters:
  value - The string to be trimmed. A string containing only the alphanumeric content ofvalue.



trimLeft
public static String trimLeft(String value)(Code)
Create a new string from value without leading whitespace.
Parameters:
  value - The string to be stripped. A copy of value with leading whitespace stripped.



trimRight
public static String trimRight(String value)(Code)
Create a new string from value without trailing whitespace.
Parameters:
  value - The string to be stripped. A copy of value with trailing whitespace stripped.



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.