Java Doc for JOrphanUtils.java in  » Testing » jakarta-jmeter » org » apache » jorphan » 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 » Testing » jakarta jmeter » org.apache.jorphan.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.jorphan.util.JOrphanUtils

JOrphanUtils
final public class JOrphanUtils (Code)
This class contains frequently-used static utility methods.




Method Summary
public static  StringbooleanToSTRING(boolean value)
    
public static  StringbooleanToString(boolean value)
    
public static  voidcloseQuietly(InputStream is)
    
public static  voidcloseQuietly(OutputStream os)
    
public static  voidcloseQuietly(Writer wr)
    
public static  voidcloseQuietly(Reader rd)
    
public static  voidcloseQuietly(Socket sock)
    
public static  voidcloseQuietly(ServerSocket sock)
    
public static  byte[]getByteArraySlice(byte[] array, int begin, int end)
     Returns a slice of a byte array.
public static  StringBufferleftAlign(StringBuffer in, int len)
     Left aligns some text in a StringBuffer N.B.
public static  StringreplaceAllChars(String source, char search, String replace)
    
public static  StringreplaceFirst(String source, String search, String replace)
     Simple-minded String.replace() for JDK1.3 Should probably be recoded...
public static  StringBufferrightAlign(StringBuffer in, int len)
     Right aligns some text in a StringBuffer N.B.
public static  String[]split(String splittee, String splitChar, boolean truncate)
     This is _almost_ equivalent to the String.split method in JDK 1.4.
public static  String[]split(String splittee, String splitChar)
    
public static  String[]split(String splittee, String delims, String def)
     Takes a String and a tokenizer character string, and returns a new array of strings of the string split by the tokenizer character(s). Trailing delimiters are significant (unless the default = null)
Parameters:
  splittee - String to be split.
Parameters:
  delims - Delimiter character(s) to split the string on
Parameters:
  def - Default value to place between two split chars that havenothing between them.
public static  Stringsubstitute(String input, String pattern, String sub)
    
public static  Stringtrim(String input, String delims)
     Trim a string by the tokens provided.
public static  BooleanvalueOf(boolean value)
    



Method Detail
booleanToSTRING
public static String booleanToSTRING(boolean value)(Code)
Convert a boolean to its string representation Equivalent to Boolean.valueOf(boolean).toString().toUpperCase() but valid also for JDK 1.3, which does not have valueOf(boolean)
Parameters:
  value - boolean to convert "TRUE" or "FALSE"



booleanToString
public static String booleanToString(boolean value)(Code)
Convert a boolean to its string representation Equivalent to Boolean.toString(boolean) but valid also for JDK 1.3, which does not have toString(boolean)
Parameters:
  value - boolean to convert "true" or "false"



closeQuietly
public static void closeQuietly(InputStream is)(Code)
close a stream with no error thrown
Parameters:
  is - - InputStream (may be null)



closeQuietly
public static void closeQuietly(OutputStream os)(Code)
close a stream with no error thrown
Parameters:
  os - - OutputStream (may be null)



closeQuietly
public static void closeQuietly(Writer wr)(Code)
close a Writer with no error thrown
Parameters:
  wr - - Writer (may be null)



closeQuietly
public static void closeQuietly(Reader rd)(Code)
close a Reader with no error thrown
Parameters:
  rd - - Reader (may be null)



closeQuietly
public static void closeQuietly(Socket sock)(Code)
close a Socket with no error thrown
Parameters:
  sock - - Socket (may be null)



closeQuietly
public static void closeQuietly(ServerSocket sock)(Code)
close a Socket with no error thrown
Parameters:
  sock - - ServerSocket (may be null)



getByteArraySlice
public static byte[] getByteArraySlice(byte[] array, int begin, int end)(Code)
Returns a slice of a byte array. TODO - add bounds checking?
Parameters:
  array - -input array
Parameters:
  begin - -start of slice
Parameters:
  end - -end of slice slice from the input array



leftAlign
public static StringBuffer leftAlign(StringBuffer in, int len)(Code)
Left aligns some text in a StringBuffer N.B. modifies the input buffer
Parameters:
  in - StringBuffer containing some text
Parameters:
  len - output length desired input StringBuffer, with trailing spaces



replaceAllChars
public static String replaceAllChars(String source, char search, String replace)(Code)
Version of String.replaceAll() for JDK1.3 See below for another version which replaces strings rather than chars
Parameters:
  source - input string
Parameters:
  search - char to look for (no regular expressions)
Parameters:
  replace - string to replace the search string the output string



replaceFirst
public static String replaceFirst(String source, String search, String replace)(Code)
Simple-minded String.replace() for JDK1.3 Should probably be recoded...
Parameters:
  source - input string
Parameters:
  search - string to look for (no regular expressions)
Parameters:
  replace - string to replace the search string the output string



rightAlign
public static StringBuffer rightAlign(StringBuffer in, int len)(Code)
Right aligns some text in a StringBuffer N.B. modifies the input buffer
Parameters:
  in - StringBuffer containing some text
Parameters:
  len - output length desired input StringBuffer, with leading spaces



split
public static String[] split(String splittee, String splitChar, boolean truncate)(Code)
This is _almost_ equivalent to the String.split method in JDK 1.4. It is here to enable us to support earlier JDKs. Note that unlike JDK1.4 split(), it optionally ignores leading split Characters, and the splitChar parameter is not a Regular expression

This piece of code used to be part of JMeterUtils, but was moved here because some JOrphan classes use it too.
Parameters:
  splittee - String to be split
Parameters:
  splitChar - Character(s) to split the string on, these are treated as a single unit
Parameters:
  truncate - Should adjacent and leading/trailing splitChars be removed? Array of all the tokens.
See Also:   JOrphanUtils.split(String,String,String)




split
public static String[] split(String splittee, String splitChar)(Code)



split
public static String[] split(String splittee, String delims, String def)(Code)
Takes a String and a tokenizer character string, and returns a new array of strings of the string split by the tokenizer character(s). Trailing delimiters are significant (unless the default = null)
Parameters:
  splittee - String to be split.
Parameters:
  delims - Delimiter character(s) to split the string on
Parameters:
  def - Default value to place between two split chars that havenothing between them. If null, then ignore omitted elements. Array of all the tokens.
throws:
  NullPointerException - if splittee or delims are null
See Also:   JOrphanUtils.split(String,String,boolean)
See Also:   JOrphanUtils.split(String,String)
See Also:   This is a rewritten version of JMeterUtils.split()



substitute
public static String substitute(String input, String pattern, String sub)(Code)
Replace all patterns in a String
See Also:   String.replaceAll(String regexString replacement)
See Also:    - JDK1.4 only
Parameters:
  input - - string to be transformed
Parameters:
  pattern - - pattern to replace
Parameters:
  sub - - replacement the updated string



trim
public static String trim(String input, String delims)(Code)
Trim a string by the tokens provided.
Parameters:
  input - string to trim
Parameters:
  delims - list of delimiters input trimmed at the first delimiter



valueOf
public static Boolean valueOf(boolean value)(Code)
Version of Boolean.valueOf(boolean) for JDK 1.3
Parameters:
  value - boolean to convert Boolean.TRUE or Boolean.FALSE



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.