Java Doc for StringFormat.java in  » Profiler » JMeasurement » de » mcs » utils » 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 » Profiler » JMeasurement » de.mcs.utils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.mcs.utils.StringFormat

StringFormat
final public class StringFormat (Code)
Implements missing String format functions as a function library.
version:
   $Revision: 1.1 $




Method Summary
public static  voidbyte2hex(byte b, StringBuffer buf)
     Converts a byte to hex digit and writes to the supplied buffer.
public static  StringcontainsChars(String source, String chars)
     Reads a string and searches for every occurence of one of the characters in chars.
public static  StringconvertEscapes(String s)
     Converts some special characters (tab, CR, LF, 0 etc) from java escape sequences to characters.
Parameters:
  s - the string to convert.
public static  intcountsChars(String searchString, char character)
     Anzahl derr zeichen zählen.
public static  StringfilterString(String input, char left, char right)
     filters a string from the given characters.
public static  StringfilterString(String input, char filterchar)
     filters a string from the given characters.
public static  StringfilterWhiteSpace(String s)
     Removes white spaces (>=ascii 32) from a string and all spaces at the end.
public static  StringformatLong(long l, int length, char fill)
     Format the String representation of the given long to the given length and fills up at the beginning with the given fill value.
public static  StringformatString(String x, int length, char fill)
     Format the String representation of the given long to the given length and fills up at the beginning with the given fill value.
public static  StringformatStringLeading(String x, int length, char fill)
     Format the String representation of the given long to the given length and fills up at the beginning with the given fill value.
public static  String[]fromCollection(Collection r)
    
public static  byte[]fromHexString(String str)
     Converts the given hex string to a byte array.
public static  StringgetList(Collection col, char sep)
     Creates a String that contains all element of the given collection, seperated by the given seperator.
public static  CollectiongetMultiLineString(String input)
     Holt aus einer Stringliste (mit CRLF getrennt) eine Collection von Strings.
public static  StringgetPathFromString(String string, int directoryDepth)
     Returns a each 2 characters separated PathString from a MD5 HexString The used separator is System.getProperty("file.separator").
public static  Map<String, String>getProperties(Collection col)
     Gets a Map of properties from a collection that contains strings like "prop=value".
public static  StringgetProperty(String property, String defaultValue, Collection col)
     Returns the value of a property.
public static  StringgetPropertyString(Map props)
     Creates a property string ( a list of comma separated key=value items) from a HashMap.
public static  StringgetStackTrace(Throwable cause)
     getting a stack trace as a string like in exception.printStackTrace.
Parameters:
  cause - the exception to convert.
public static  Stringleft(String string, int pos)
    
public static  Stringmd5String(String s)
     Method md5String.
public static  ListparseList(String col, char sep)
     Parses the given String and returns a collection of String elements.
public static  StringreplaceString(String newString, String source, String searchStr)
     Method replaceString.
public static  Stringright(String string, int pos)
    
public static  Stringrtrim(String s)
     rightrim.
public static  StringsaveConvert(String theString, boolean escapeSpace)
     converting a string so that it can be saved into a human readable file.
Parameters:
  theString - the string to convert
Parameters:
  escapeSpace - spaces must be escaped.
public static  StringsetProperty(String property, String value, String propertyString)
     Sets a property in a property string list.
public static  String[]splitFirst(String string, String search)
    
public static  intstrToInt(String strNum)
     Converts a string to its int equivalent.
public static  StringtoHexString(byte[] block)
     Converts a byte array to hex string.
public static  StringwellForm(String g)
     Creates a well formed XML string.



Method Detail
byte2hex
public static void byte2hex(byte b, StringBuffer buf)(Code)
Converts a byte to hex digit and writes to the supplied buffer.
Parameters:
  b - byte to convert
Parameters:
  buf - StringBuffer to append to



containsChars
public static String containsChars(String source, String chars)(Code)
Reads a string and searches for every occurence of one of the characters in chars. If the character occurs in chars it will be added to the result. If none of the characters in chars occurs in source, the method will return null.
Parameters:
  source - the source to check
Parameters:
  chars - a string that contains every character to check for. the result of occurences of characters from charsin source or null.



convertEscapes
public static String convertEscapes(String s)(Code)
Converts some special characters (tab, CR, LF, 0 etc) from java escape sequences to characters.
Parameters:
  s - the string to convert. the converted string



countsChars
public static int countsChars(String searchString, char character)(Code)
Anzahl derr zeichen zählen.
Parameters:
  searchString - the string to count chars
Parameters:
  character - the character to count the count of chars



filterString
public static String filterString(String input, char left, char right)(Code)
filters a string from the given characters. Example: filterString ("{blabla}", " {", "}") returns blabla
Parameters:
  input - input String
Parameters:
  left - linke Begrenzung
Parameters:
  right - rechte Begrenzung the_filtered_string



filterString
public static String filterString(String input, char filterchar)(Code)
filters a string from the given characters. Example: filterString ("'blabla'", " '") returns blabla
Parameters:
  input - zu filternder String
Parameters:
  filterchar - begrenzungszeichen the_filtered_string



filterWhiteSpace
public static String filterWhiteSpace(String s)(Code)
Removes white spaces (>=ascii 32) from a string and all spaces at the end.
Parameters:
  s - the input string a string without whitespaces



formatLong
public static String formatLong(long l, int length, char fill)(Code)
Format the String representation of the given long to the given length and fills up at the beginning with the given fill value. l=654, length=5, fill='0' will lead to '00654'. If the result of l is longer than length, the full length of l is return
Parameters:
  l - the long to be converted
Parameters:
  length - the length of the result
Parameters:
  fill - the fill value of the result the formatted string



formatString
public static String formatString(String x, int length, char fill)(Code)
Format the String representation of the given long to the given length and fills up at the beginning with the given fill value. l=654, length=5, fill='0' will lead to '00654'. If the result of l is longer than length, the full length of l is return
Parameters:
  x - the long to be converted
Parameters:
  length - the length of the result
Parameters:
  fill - the fill value of the result the formatted string



formatStringLeading
public static String formatStringLeading(String x, int length, char fill)(Code)
Format the String representation of the given long to the given length and fills up at the beginning with the given fill value. l=654, length=5, fill='0' will lead to '00654'. If the result of l is longer than length, the full length of l is return
Parameters:
  x - the long to be converted
Parameters:
  length - the length of the result
Parameters:
  fill - the fill value of the result the formatted string



fromCollection
public static String[] fromCollection(Collection r)(Code)

Parameters:
  r - a colletion that contains strings a String array



fromHexString
public static byte[] fromHexString(String str)(Code)
Converts the given hex string to a byte array. The hex string is interpreted as a sequence of hex digit pairs in high, low order. For odd length strings the last digit is interpreted as low value.
Parameters:
  str - The hex string to convert to a byte array. A byte array containing the byte values of the hex string. throwsNumberFormatException if the given string isn't a hex string



getList
public static String getList(Collection col, char sep)(Code)
Creates a String that contains all element of the given collection, seperated by the given seperator.
Parameters:
  col - a collection of objects
Parameters:
  sep - the seperator result String



getMultiLineString
public static Collection getMultiLineString(String input)(Code)
Holt aus einer Stringliste (mit CRLF getrennt) eine Collection von Strings.
Parameters:
  input - EingangsString Collection



getPathFromString
public static String getPathFromString(String string, int directoryDepth)(Code)
Returns a each 2 characters separated PathString from a MD5 HexString The used separator is System.getProperty("file.separator").
Parameters:
  string - der String der gewandelt werden soll
Parameters:
  directoryDepth - Die Anzahl der Unterverzeichisse String



getProperties
public static Map<String, String> getProperties(Collection col)(Code)
Gets a Map of properties from a collection that contains strings like "prop=value".
Parameters:
  col - the properties a map



getProperty
public static String getProperty(String property, String defaultValue, Collection col)(Code)
Returns the value of a property. The given collection should contain strings with "name=value" entries. The method looks for the name and returns the value, else returns the default value
Parameters:
  property - ???
Parameters:
  defaultValue - ???
Parameters:
  col - ??? the value of the property or the default



getPropertyString
public static String getPropertyString(Map props)(Code)
Creates a property string ( a list of comma separated key=value items) from a HashMap.
Parameters:
  props - the properties a string that contains the key=value list



getStackTrace
public static String getStackTrace(Throwable cause)(Code)
getting a stack trace as a string like in exception.printStackTrace.
Parameters:
  cause - the exception to convert. String



left
public static String left(String string, int pos)(Code)



md5String
public static String md5String(String s)(Code)
Method md5String.
Parameters:
  s - String String



parseList
public static List parseList(String col, char sep)(Code)
Parses the given String and returns a collection of String elements. If the separator must be part of the String, the single string element must be included in '"'
Parameters:
  col - a string with separated strings
Parameters:
  sep - a seperator a collection of strings



replaceString
public static String replaceString(String newString, String source, String searchStr)(Code)
Method replaceString.
Parameters:
  newString - String
Parameters:
  source - String
Parameters:
  searchStr - String String



right
public static String right(String string, int pos)(Code)



rtrim
public static String rtrim(String s)(Code)
rightrim.
Parameters:
  s - inputstring string



saveConvert
public static String saveConvert(String theString, boolean escapeSpace)(Code)
converting a string so that it can be saved into a human readable file.
Parameters:
  theString - the string to convert
Parameters:
  escapeSpace - spaces must be escaped. the converted String.



setProperty
public static String setProperty(String property, String value, String propertyString)(Code)
Sets a property in a property string list.
Parameters:
  property - the name of the property
Parameters:
  value - the value
Parameters:
  propertyString - the property string list the result



splitFirst
public static String[] splitFirst(String string, String search)(Code)



strToInt
public static int strToInt(String strNum)(Code)
Converts a string to its int equivalent.
Parameters:
  strNum - The string that should be converted int The int version of the string value throwsNumberFormatException if the given String isn't a textualrepresentation of an int value.



toHexString
public static String toHexString(byte[] block)(Code)
Converts a byte array to hex string.
Parameters:
  block - bytearray to convert String Hexstring representing the block, constisting only fromuppercase letters [0-9A-F]*



wellForm
public static String wellForm(String g)(Code)
Creates a well formed XML string.
Parameters:
  g - original string a well formed 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.