Java Doc for Util.java in  » J2EE » Sofia » com » salmonllc » 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 » J2EE » Sofia » com.salmonllc.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.salmonllc.util.Util

Util
public class Util (Code)
This class is used to hold general helper methods




Method Summary
public static  StringaddAndFilter(String filter, String add)
     This method was created in VisualAge.
public static  voidaddAndFilter(StringBuffer filter, String add)
     This method was created in VisualAge.
public static  StringaddHtmlComment(String commentStr)
     This method returns what you passed in as a Html Comment.
public static  StringaddOrFilter(String filter, String add)
     This method was created in VisualAge.
public static  voidaddOrFilter(StringBuffer filter, String add)
     This method was created in VisualAge.
public static  voidaddSPParameter(StringBuffer paramString, String add, int type)
     This method was created in VisualAge.
public static  StringaddToINClause(String clause, String add, int type)
     This method was created in VisualAge.
public static  voidexecuteMethod(Object comp, String propertyName, Object value)
     This method will will automatically set a property value on the specified component.
public static  voidexecuteReflectedMethod(Object comp, Method meth, Object value)
     This method is used to execute set methods indirectly.
public static  ThrowablegetCause(Exception e)
    
public static  java.sql.DategetDateObject(int iYear, int iMonth, int iDay, int iHour, int iMinute)
    
public static  intgetDaysElapsed(java.sql.Timestamp compDate)
     Returns the number of whole days that have elapsed from a given day to today.
public  HtmlScriptgetPrintScript(HtmlSubmitImage submitBtn, HtmlPage p)
     This method returns a HTML script that opens the print dialog box of the browser.
public static  intindexOfOccurence(String searchStr, String source, int numOfOcurrence)
     This method finds the nth occurrence of a string within another string and return the location within the source string
Parameters:
  searchStr - is the string to search for.
Parameters:
  source - is the string to be searched.
Parameters:
  numOfOcurrence - is the number of occurrence we are looking for.
public static  booleaninstanceOf(Class class1, Class class2)
    
public static  booleanisDouble(String s)
     This method checks to see if the string passed into it is a double value.
public static  booleanisEmpty(Object objToCheck)
    
public static  booleanisFilled(String s)
     This method checks to see if the string passed into it contains any letters or digits.
public static  booleanisInteger(String s)
     This method checks to see if the string passed into it is an integer value.
public static  booleanisNull(Object objToCheck)
    
public static  booleanisNumeric(String s)
     This method checks to see if the string passed into it contains all numeric digits.
public static  booleanisTrue(int intToCheck)
     Check an int and returns if it resolves to true boolean value.
public static  booleanisTrue(String strToCheck)
     Check a string and returns if it resolves to true boolean value.
public static  intjavaClassToDataStoreType(String val)
    
public static  voidmakeSureNotNull(DataStore ds, int row, String colName)
     This method checks a column to see if it has been filled.
public static  voidmakeSureNotNull(DataStore ds, int row, String colName, Object defaultVal)
     This method checks a column to see if it has been filled.
public static  voidmakeSureNotNull(DataStore ds, String colName)
     This method checks a column to see if it has been filled.
final public static  StringpadString(String sPassed, int iPadLength, char cPadChar)
     This function is used to pad a string to the specified length with a specific character and return this created string. If passed String is greater than iPadLength than the string is chopped to that length.
Parameters:
  sPassed - String - the string to be padded.
Parameters:
  iPadLength - int - the length of the resulting string.
Parameters:
  cPadChar - char - the character to pad the string with.
final public static  StringpadStringInFront(String sPassed, int iPadLength, char cPadChar)
     This function is used to pad a string in the front to the specified length with a specific character and return this created string. If passed String is greater than iPadLength than the string is chopped to that length.
Parameters:
  sPassed - String - the string to be padded.
Parameters:
  iPadLength - int - the length of the resulting string.
Parameters:
  cPadChar - char - the character to pad the string with.
public static  StringreplaceString(String source, String searchStr, String replaceStr)
     This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr) replaces all occurences
Parameters:
  source - is the string to be searched.
Parameters:
  searchStr - is the string to search for.
Parameters:
  replaceStr - is the string that replaces searchStr in soucre.
public static  StringreplaceString(String source, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)
     This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)
Parameters:
  source - is the string to be searched.
Parameters:
  searchStr - is the string to search for.
Parameters:
  replaceStr - is the string that replaces searchStr in soucre.
public static  voidsetTo100Percent(HtmlDataTable dataTable)
    
public static  voidsetTo100Percent(HtmlDisplayBox dispBox)
    
public static  voidsetTo100Percent(HtmlTable table)
    
public static  String[]split(String st, String delimiter)
    
public static  intstringCount(String source, String searchStr)
    
public static  booleanstringToBoolean(String val)
    
public static  booleanstringToBoolean(String val, boolean def)
    
public static  ColorstringToColor(String s)
     This method will return the Color-object equivalent of a string
Parameters:
  s - - colr passed as a string.
public static  intstringToInt(String val)
    
public static  StringstripChars(String s)
     This method returns a new string containing only letters and numeric digits in the original string.
public static  StringstripChars(String source, String allowedChars, String disallowedChars)
     This method returns a new string with only the allowed characters and no disallowed characters.
public static  StringstripDotJsp(String s)
     This method returns a new string containing only the root string with no .jsp.
public static  StringstripHtmlFromText(String stripString)
    
public static  StringstripSpecialChars(String sField)
     This method returns a string containing only digits and the decimal point.
public static  java.sql.DatetimeToDate(java.sql.Timestamp timeStampToConvert)
    
public static  StringurlEncode(String s)
     This method will remove illegal characters for strings so they can be placed in a url link.
public static  StringurlEncode(String s, boolean encodeFull)
     This method will remove illegal characters for strings so they can be placed in a url link.



Method Detail
addAndFilter
public static String addAndFilter(String filter, String add)(Code)
This method was created in VisualAge.
Parameters:
  filter - java.lang.String
Parameters:
  add - java.lang.String java.lang.String



addAndFilter
public static void addAndFilter(StringBuffer filter, String add)(Code)
This method was created in VisualAge.
Parameters:
  filter - java.lang.String
Parameters:
  add - java.lang.String



addHtmlComment
public static String addHtmlComment(String commentStr)(Code)
This method returns what you passed in as a Html Comment.
Parameters:
  commentStr - - String that will be wrapped in an html comment String



addOrFilter
public static String addOrFilter(String filter, String add)(Code)
This method was created in VisualAge.
Parameters:
  filter - java.lang.String
Parameters:
  add - java.lang.String java.lang.String



addOrFilter
public static void addOrFilter(StringBuffer filter, String add)(Code)
This method was created in VisualAge.
Parameters:
  filter - java.lang.String
Parameters:
  add - java.lang.String



addSPParameter
public static void addSPParameter(StringBuffer paramString, String add, int type)(Code)
This method was created in VisualAge.
Parameters:
  paramString - java.lang.String
Parameters:
  add - java.lang.String
Parameters:
  type - int type of param



addToINClause
public static String addToINClause(String clause, String add, int type)(Code)
This method was created in VisualAge.
Parameters:
  clause - java.lang.String
Parameters:
  add - java.lang.String
Parameters:
  type - int type of param java.lang.String



executeMethod
public static void executeMethod(Object comp, String propertyName, Object value) throws NoSuchMethodException(Code)
This method will will automatically set a property value on the specified component. This can be used for example to make a component invisible or visible depending on the value in the datastore for a particular row: ex: addPropertyExpression(comp,"visible","bucket==1") will call the setVisible method on the component comp passing the results of the expression.
Parameters:
  comp - The component to set the property for
Parameters:
  propertyName - The name of the property to set. The component must have a corresponding setProperty method or this method will throw a NoSuchMethodException
Parameters:
  value - - The value being passed to the method
exception:
  NoSuchMethodException - The exception description.



executeReflectedMethod
public static void executeReflectedMethod(Object comp, Method meth, Object value)(Code)
This method is used to execute set methods indirectly.
Parameters:
  comp - DOCUMENT ME!
Parameters:
  meth - DOCUMENT ME!
Parameters:
  value - DOCUMENT ME!



getCause
public static Throwable getCause(Exception e)(Code)
Returns the cause for the exception, JDK 1.4 and above only
Parameters:
  e -



getDateObject
public static java.sql.Date getDateObject(int iYear, int iMonth, int iDay, int iHour, int iMinute)(Code)



getDaysElapsed
public static int getDaysElapsed(java.sql.Timestamp compDate)(Code)
Returns the number of whole days that have elapsed from a given day to today. If the given day is today, it will return zero. If the day is yesterday, it will return 1, etc. If the given day is in the future, the reult will be a negative number.
Parameters:
  comDate - - the date to compare to int



getPrintScript
public HtmlScript getPrintScript(HtmlSubmitImage submitBtn, HtmlPage p)(Code)
This method returns a HTML script that opens the print dialog box of the browser.
Parameters:
  submitBtn - - Button that will get the script added to it
Parameters:
  p - - Page HtmlScript



indexOfOccurence
public static int indexOfOccurence(String searchStr, String source, int numOfOcurrence)(Code)
This method finds the nth occurrence of a string within another string and return the location within the source string
Parameters:
  searchStr - is the string to search for.
Parameters:
  source - is the string to be searched.
Parameters:
  numOfOcurrence - is the number of occurrence we are looking for. int index of occurence



instanceOf
public static boolean instanceOf(Class class1, Class class2)(Code)
Returns true if class2 is a subclass of class1
Parameters:
  class1 -
Parameters:
  class2 -



isDouble
public static boolean isDouble(String s)(Code)
This method checks to see if the string passed into it is a double value. It returns true if the string parses to a double.
Parameters:
  s - java.lang.String boolean If the String is a double value



isEmpty
public static boolean isEmpty(Object objToCheck)(Code)
Checks a String to see if it is empty ""
Parameters:
  objToCheck - - object to check boolean true if it is empty



isFilled
public static boolean isFilled(String s)(Code)
This method checks to see if the string passed into it contains any letters or digits. It returns a true or false value whether or not the string has any characters in it.
Parameters:
  s - java.lang.String boolean



isInteger
public static boolean isInteger(String s)(Code)
This method checks to see if the string passed into it is an integer value. It returns true if the string parses to an integer.
Parameters:
  s - java.lang.String boolean If the String is an integer value



isNull
public static boolean isNull(Object objToCheck)(Code)
Checks an Object to see if it is null
Parameters:
  objToCheck - - object to check boolean true if it is null



isNumeric
public static boolean isNumeric(String s)(Code)
This method checks to see if the string passed into it contains all numeric digits. It returns true if the string contains only digits.
Parameters:
  s - java.lang.String boolean If the String is numeric



isTrue
public static boolean isTrue(int intToCheck)(Code)
Check an int and returns if it resolves to true boolean value. numbers greater then 0 are treated as true
Parameters:
  intToCheck - - Int to check boolean



isTrue
public static boolean isTrue(String strToCheck)(Code)
Check a string and returns if it resolves to true boolean value. numbers greater then 0 are treated as true
Parameters:
  strToCheck - - String to check boolean



javaClassToDataStoreType
public static int javaClassToDataStoreType(String val)(Code)
Maps a string to a datastore datatype constant
Parameters:
  val - int value that is DataStore.DATATYPE_



makeSureNotNull
public static void makeSureNotNull(DataStore ds, int row, String colName) throws Exception(Code)
This method checks a column to see if it has been filled. If it has not been filled it with a safe value.
Parameters:
  ds - DataStore the datastore to use during checking
Parameters:
  row - int
Parameters:
  colName - String
throws:
  Exception - - if column is not found



makeSureNotNull
public static void makeSureNotNull(DataStore ds, int row, String colName, Object defaultVal) throws Exception(Code)
This method checks a column to see if it has been filled. If it has not been filled it with a safe value.
Parameters:
  ds - DataStore the datastore to use during checking
Parameters:
  row - - row to check
Parameters:
  colName - - column to check
Parameters:
  defaultVal - - Object You can specify what your defaultvalue should be.
throws:
  Exception - - if column is not found



makeSureNotNull
public static void makeSureNotNull(DataStore ds, String colName) throws Exception(Code)
This method checks a column to see if it has been filled. If it has not been filled it with a safe value.
Parameters:
  ds - DataStore the datastore to use during checking
Parameters:
  colName - - column to check
throws:
  Exception - - if column is not found



padString
final public static String padString(String sPassed, int iPadLength, char cPadChar)(Code)
This function is used to pad a string to the specified length with a specific character and return this created string. If passed String is greater than iPadLength than the string is chopped to that length.
Parameters:
  sPassed - String - the string to be padded.
Parameters:
  iPadLength - int - the length of the resulting string.
Parameters:
  cPadChar - char - the character to pad the string with. String - the padded string of the operation.



padStringInFront
final public static String padStringInFront(String sPassed, int iPadLength, char cPadChar)(Code)
This function is used to pad a string in the front to the specified length with a specific character and return this created string. If passed String is greater than iPadLength than the string is chopped to that length.
Parameters:
  sPassed - String - the string to be padded.
Parameters:
  iPadLength - int - the length of the resulting string.
Parameters:
  cPadChar - char - the character to pad the string with. String - the padded string of the operation.



replaceString
public static String replaceString(String source, String searchStr, String replaceStr)(Code)
This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr) replaces all occurences
Parameters:
  source - is the string to be searched.
Parameters:
  searchStr - is the string to search for.
Parameters:
  replaceStr - is the string that replaces searchStr in soucre. If omitted, replacement is the empty string. DOCUMENT ME!



replaceString
public static String replaceString(String source, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)(Code)
This method replaces strings within another string with a third specified string Usage: replaceString(StringBuffer soucre, String searchStr, String replaceStr, int startOcurrence, int numOfOccurences)
Parameters:
  source - is the string to be searched.
Parameters:
  searchStr - is the string to search for.
Parameters:
  replaceStr - is the string that replaces searchStr in soucre. If omitted, replacement is the empty string.
Parameters:
  startOcurrence - is the first occurrence of searchStr that is replaced. If omitted, the first occurrence is used.
Parameters:
  numOfOccurences - is the number of occurrences of searchStr that are replaced. If omitted, all occurrences are replaced. DOCUMENT ME!



setTo100Percent
public static void setTo100Percent(HtmlDataTable dataTable)(Code)
This method sets the width of the passed in HtmlDataTable to 100 percent
Parameters:
  dataTable - - HtmlDataTable to be sized



setTo100Percent
public static void setTo100Percent(HtmlDisplayBox dispBox)(Code)
This method sets the width of the passed in HtmlDisplayBox to 100 percent
Parameters:
  dispBox - - HtmlDisplayBox to be sized



setTo100Percent
public static void setTo100Percent(HtmlTable table)(Code)
This method sets the width of the passed in HtmlDisplayBox to 100 percent
Parameters:
  table - - HtmlTable to be sized



split
public static String[] split(String st, String delimiter)(Code)
Splits a String into an array of Strings based on a delimiter
Parameters:
  st -



stringCount
public static int stringCount(String source, String searchStr)(Code)
This method Counts the number of occurences of one string within another
Parameters:
  source - - String to be searched in
Parameters:
  searchStr - - String that is tring to be found number of occurences



stringToBoolean
public static boolean stringToBoolean(String val)(Code)
Attempts to convert a string into its boolean equivalent; otherwise returns the true
Parameters:
  val - - String to be converted boolean



stringToBoolean
public static boolean stringToBoolean(String val, boolean def)(Code)
Attempts to convert a string into its boolean equivalent; otherwise returns the default
Parameters:
  val - java.lang.String
Parameters:
  def - boolean boolean



stringToColor
public static Color stringToColor(String s)(Code)
This method will return the Color-object equivalent of a string
Parameters:
  s - - colr passed as a string. Color



stringToInt
public static int stringToInt(String val)(Code)
Converts a string to an int or returns -1 if it can't
Parameters:
  val - - value to convert int



stripChars
public static String stripChars(String s)(Code)
This method returns a new string containing only letters and numeric digits in the original string.
Parameters:
  s - java.lang.String string to be stripped of all characters other than letters or digits java.lang.String the new string containing only letters or digits



stripChars
public static String stripChars(String source, String allowedChars, String disallowedChars)(Code)
This method returns a new string with only the allowed characters and no disallowed characters.
Parameters:
  source - java.lang.String source string
Parameters:
  allowedChars - a String containing the characters allowed to be in the resulting string.
Parameters:
  disallowedChars - a String containing the characters disallowed to be in the resulting string the new formatted string containing the allowed characters and not containing the disallowed characters.



stripDotJsp
public static String stripDotJsp(String s)(Code)
This method returns a new string containing only the root string with no .jsp.
Parameters:
  s - java.lang.String string to be stripped java.lang.String the new string containing only root string.



stripHtmlFromText
public static String stripHtmlFromText(String stripString)(Code)
Removes the html from an html string and leaves only the text
Parameters:
  stripString - - String to strip html from - stripped String



stripSpecialChars
public static String stripSpecialChars(String sField)(Code)
This method returns a string containing only digits and the decimal point.
Parameters:
  sField - java.lang.String java.lang.String a string containing only digits and the decimal point



timeToDate
public static java.sql.Date timeToDate(java.sql.Timestamp timeStampToConvert)(Code)
Convert a java.sql.Timestamp to a valid java.sql.Date
Parameters:
  timeStampToConvert - - Timestamp to convert valid java.sql.Date if a null is passed in a null is back out



urlEncode
public static String urlEncode(String s)(Code)
This method will remove illegal characters for strings so they can be placed in a url link.
Parameters:
  s - - string to work on - encoded String



urlEncode
public static String urlEncode(String s, boolean encodeFull)(Code)
This method will remove illegal characters for strings so they can be placed in a url link.
Parameters:
  s - - string to work on
Parameters:
  encodeFull - - whether to encode all characters - encoded 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.