Java Doc for StringUtil.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » 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 » Database DBMS » db derby 10.2 » org.apache.derby.iapi.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.util.StringUtil

StringUtil
public class StringUtil (Code)
A set of public static methods for dealing with Strings




Method Summary
public static  booleanSQLEqualsIgnoreCase(String s1, String s2)
    
public static  StringSQLToLowerCase(String s)
    
public static  StringSQLToUpperCase(String s)
    
final public static  StringformatForPrint(String input)
     Used to print out a string for error messages, chops is off at 60 chars for historical reasons.
public static  byte[]fromHexString(String s, int offset, int length)
     Convert a hexidecimal string generated by toHexString() back into a byte array.
Parameters:
  s - String to convert
Parameters:
  offset - starting character (zero based) to convert.
Parameters:
  length - number of characters to convert.
public static  byte[]getAsciiBytes(String input)
     Get 7-bit ASCII character array from input String. The lower 7 bits of each character in the input string is assumed to be the ASCII character value. Hexadecimal - Character | 00 NUL| 01 SOH| 02 STX| 03 ETX| 04 EOT| 05 ENQ| 06 ACK| 07 BEL| | 08 BS | 09 HT | 0A NL | 0B VT | 0C NP | 0D CR | 0E SO | 0F SI | | 10 DLE| 11 DC1| 12 DC2| 13 DC3| 14 DC4| 15 NAK| 16 SYN| 17 ETB| | 18 CAN| 19 EM | 1A SUB| 1B ESC| 1C FS | 1D GS | 1E RS | 1F US | | 20 SP | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | | 28 ( | 29 ) | 2A * | 2B + | 2C , | 2D - | 2E .
public static  StringhexDump(byte[] data)
     Convert a byte array to a human-readable String for debugging purposes.
public static  Stringslice(String value, int beginOffset, int endOffset, boolean trim)
     Return a slice (substring) of the passed in value, optionally trimmed.
public static  byte[]toHexByte(String str, int offset, int length)
     Convert a string into a byte array in hex format.
For each character (b) two bytes are generated, the first byte represents the high nibble (4 bits) in hexidecimal (b & 0xf0), the second byte represents the low nibble (b & 0x0f).
The character at str.charAt(0) is represented by the first two bytes in the returned String.
Parameters:
  str - string
Parameters:
  offset - starting character (zero based) to convert.
Parameters:
  length - number of characters to convert.
public static  StringtoHexString(byte[] data, int offset, int length)
     Convert a byte array to a String with a hexidecimal format. The String may be converted back to a byte array using fromHexString.
For each byte (b) two characaters are generated, the first character represents the high nibble (4 bits) in hexidecimal (b & 0xf0), the second character represents the low nibble (b & 0x0f).
The byte at data[offset] is represented by the first two characters in the returned String.
Parameters:
  data - byte array
Parameters:
  offset - starting byte (zero based) to convert.
Parameters:
  length - number of bytes to convert.
public static  String[]toStringArray(Object[] objArray)
     A method that receive an array of Objects and return a String array representation of that array.
public static  StringtrimTrailing(String str)
    
public static  Stringtruncate(String value, int length)
     Truncate a String to the given length with no warnings or error raised if it is bigger.



Method Detail
SQLEqualsIgnoreCase
public static boolean SQLEqualsIgnoreCase(String s1, String s2)(Code)
Compares two strings Strings will be uppercased in english and compared equivalent to s1.equalsIgnoreCase(s2) throws NPE if s1 is null
Parameters:
  s1 - first string to compare
Parameters:
  s2 - second string to compare true if the two upppercased ENGLISH values are equalreturn false if s2 is null



SQLToLowerCase
public static String SQLToLowerCase(String s)(Code)
Convert string to lowercase Return java.util.Locale.ENGLISH lowercasing
Parameters:
  s - string to lowercase lowercased string



SQLToUpperCase
public static String SQLToUpperCase(String s)(Code)
Convert string to uppercase Always use the java.util.ENGLISH locale
Parameters:
  s - string to uppercase uppercased string



formatForPrint
final public static String formatForPrint(String input)(Code)
Used to print out a string for error messages, chops is off at 60 chars for historical reasons.



fromHexString
public static byte[] fromHexString(String s, int offset, int length)(Code)
Convert a hexidecimal string generated by toHexString() back into a byte array.
Parameters:
  s - String to convert
Parameters:
  offset - starting character (zero based) to convert.
Parameters:
  length - number of characters to convert. the converted byte array. Returns null if the length isnot a multiple of 2.



getAsciiBytes
public static byte[] getAsciiBytes(String input)(Code)
Get 7-bit ASCII character array from input String. The lower 7 bits of each character in the input string is assumed to be the ASCII character value. Hexadecimal - Character | 00 NUL| 01 SOH| 02 STX| 03 ETX| 04 EOT| 05 ENQ| 06 ACK| 07 BEL| | 08 BS | 09 HT | 0A NL | 0B VT | 0C NP | 0D CR | 0E SO | 0F SI | | 10 DLE| 11 DC1| 12 DC2| 13 DC3| 14 DC4| 15 NAK| 16 SYN| 17 ETB| | 18 CAN| 19 EM | 1A SUB| 1B ESC| 1C FS | 1D GS | 1E RS | 1F US | | 20 SP | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | | 28 ( | 29 ) | 2A * | 2B + | 2C , | 2D - | 2E . | 2F / | | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | | 38 8 | 39 9 | 3A : | 3B ; | 3C < | 3D = | 3E > | 3F ? | | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | | 48 H | 49 I | 4A J | 4B K | 4C L | 4D M | 4E N | 4F O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5A Z | 5B [ | 5C \ | 5D ] | 5E ^ | 5F _ | | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | | 68 h | 69 i | 6A j | 6B k | 6C l | 6D m | 6E n | 6F o | | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | | 78 x | 79 y | 7A z | 7B { | 7C | | 7D } | 7E ~ | 7F DEL|



hexDump
public static String hexDump(byte[] data)(Code)
Convert a byte array to a human-readable String for debugging purposes.



slice
public static String slice(String value, int beginOffset, int endOffset, boolean trim)(Code)
Return a slice (substring) of the passed in value, optionally trimmed. WARNING - endOffset is inclusive for historical reasons, unlike String.substring() which has an exclusive ending offset.
Parameters:
  value - Value to slice, must be non-null.
Parameters:
  beginOffset - Inclusive start character
Parameters:
  endOffset - Inclusive end character
Parameters:
  trim - To trim or not to trim Sliceed value.



toHexByte
public static byte[] toHexByte(String str, int offset, int length)(Code)
Convert a string into a byte array in hex format.
For each character (b) two bytes are generated, the first byte represents the high nibble (4 bits) in hexidecimal (b & 0xf0), the second byte represents the low nibble (b & 0x0f).
The character at str.charAt(0) is represented by the first two bytes in the returned String.
Parameters:
  str - string
Parameters:
  offset - starting character (zero based) to convert.
Parameters:
  length - number of characters to convert. the byte[] (with hexidecimal format) form of the string (str)



toHexString
public static String toHexString(byte[] data, int offset, int length)(Code)
Convert a byte array to a String with a hexidecimal format. The String may be converted back to a byte array using fromHexString.
For each byte (b) two characaters are generated, the first character represents the high nibble (4 bits) in hexidecimal (b & 0xf0), the second character represents the low nibble (b & 0x0f).
The byte at data[offset] is represented by the first two characters in the returned String.
Parameters:
  data - byte array
Parameters:
  offset - starting byte (zero based) to convert.
Parameters:
  length - number of bytes to convert. the String (with hexidecimal format) form of the byte array



toStringArray
public static String[] toStringArray(Object[] objArray)(Code)
A method that receive an array of Objects and return a String array representation of that array.



trimTrailing
public static String trimTrailing(String str)(Code)
Trim off trailing blanks but not leading blanks
Parameters:
  str - The input with trailing blanks stipped off



truncate
public static String truncate(String value, int length)(Code)
Truncate a String to the given length with no warnings or error raised if it is bigger.
Parameters:
  value - String to be truncated
Parameters:
  length - Maximum length of string Returns value if value is null or value.length() is less or equal to than length, otherwise a String representingvalue truncated to length.



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.