Java Doc for Util.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » internal » 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 » IDE Eclipse » ui workbench » org.eclipse.ui.internal.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.ui.internal.util.Util

Util
final public class Util (Code)


Field Summary
final public static  SortedMapEMPTY_SORTED_MAP
    
final public static  SortedSetEMPTY_SORTED_SET
    
final public static  StringZERO_LENGTH_STRING
    


Method Summary
public static  Object[]appendArray(Object[] array1, Object[] array2)
    
public static  voidarrayCopyWithRemoval(Object[] src, Object[] dst, int idxToRemove)
    
public static  voidassertInstance(Object object, Class c)
    
public static  voidassertInstance(Object object, Class c, boolean allowNull)
    
public static  intcompare(boolean left, boolean right)
    
public static  intcompare(Comparable left, Comparable right)
    
public static  intcompare(Comparable[] left, Comparable[] right)
    
public static  intcompare(int left, int right)
    
public static  intcompare(List left, List right)
    
public static  intcompare(Object left, Object right)
    
final public static  intcompareIdentity(Object left, Object right)
     An optimized comparison that uses identity hash codes to perform the comparison between non- null objects.
Parameters:
  left - The left-hand side of the comparison; may be null.
Parameters:
  right - The right-hand side of the comparison; may benull.
public static  voiddiff(Map left, Map right, Set leftOnly, Set different, Set rightOnly)
    
public static  voiddiff(Set left, Set right, Set leftOnly, Set rightOnly)
    
public static  booleanendsWith(List left, List right, boolean equals)
    
public static  booleanendsWith(Object[] left, Object[] right, boolean equals)
    
public static  booleanequals(boolean left, boolean right)
    
public static  booleanequals(int left, int right)
    
public static  booleanequals(Object left, Object right)
    
final public static  booleanequals(Object[] leftArray, Object[] rightArray)
     Tests whether two arrays of objects are equal to each other.
public static  ObjectgetAdapter(Object sourceObject, Class adapterType)
     If it is possible to adapt the given object to the given type, this returns the adapter.
public static  String[]getArrayFromList(String prop, String separator)
     Returns the result of converting a list of comma-separated tokens into an array.
public static  ShellgetShellToParentOn()
     Return an appropriate shell to parent dialogs on.
public static  IWorkbenchWindowgetWorkbenchWindowForShell(Shell shellToCheck)
     Return the window for the given shell or the currently active window if one could not be determined.
public static  inthashCode(boolean b)
    
public static  inthashCode(int i)
    
public static  inthashCode(Object object)
    
public static  Stringintern(String string)
    
public static  StringreplaceAll(String src, String find, String replacement)
     Foundation replacement for String.replaceAll(*).
Parameters:
  src - the starting string.
Parameters:
  find - the string to find.
Parameters:
  replacement - the string to replace.
public static  CollectionsafeCopy(Collection collection, Class c)
    
public static  CollectionsafeCopy(Collection collection, Class c, boolean allowNullElements)
    
public static  ListsafeCopy(List list, Class c)
    
public static  ListsafeCopy(List list, Class c, boolean allowNullElements)
    
public static  MapsafeCopy(Map map, Class keyClass, Class valueClass)
    
public static  MapsafeCopy(Map map, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues)
    
public static  SetsafeCopy(Set set, Class c)
    
public static  SetsafeCopy(Set set, Class c, boolean allowNullElements)
    
public static  SortedMapsafeCopy(SortedMap sortedMap, Class keyClass, Class valueClass)
    
public static  SortedMapsafeCopy(SortedMap sortedMap, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues)
    
public static  SortedSetsafeCopy(SortedSet sortedSet, Class c)
    
public static  SortedSetsafeCopy(SortedSet sortedSet, Class c, boolean allowNullElements)
    
public static  ObjectsafeLoadExecutableExtension(IConfigurationElement element, String attName, Class classSpec)
     Attempt to load the executable extension from the element/attName.
public static  StringsafeString(String input)
     Ensures that a string is not null.
public static  String[]split(String src, char delim)
     Splits a string at the first occurance of the delimiting char. If the source string is null then so is the result.
public static  booleanstartsWith(List left, List right, boolean equals)
    
public static  booleanstartsWith(Object[] left, Object[] right, boolean equals)
    
public static  StringtranslateString(ResourceBundle resourceBundle, String key)
    
public static  StringtranslateString(ResourceBundle resourceBundle, String key, String string, boolean signal, boolean trim)
    

Field Detail
EMPTY_SORTED_MAP
final public static SortedMap EMPTY_SORTED_MAP(Code)



EMPTY_SORTED_SET
final public static SortedSet EMPTY_SORTED_SET(Code)



ZERO_LENGTH_STRING
final public static String ZERO_LENGTH_STRING(Code)





Method Detail
appendArray
public static Object[] appendArray(Object[] array1, Object[] array2)(Code)
Appends array2 to the end of array1 and returns the result
Parameters:
  array1 -
Parameters:
  array2 -
since:
   3.1



arrayCopyWithRemoval
public static void arrayCopyWithRemoval(Object[] src, Object[] dst, int idxToRemove)(Code)



assertInstance
public static void assertInstance(Object object, Class c)(Code)



assertInstance
public static void assertInstance(Object object, Class c, boolean allowNull)(Code)



compare
public static int compare(boolean left, boolean right)(Code)



compare
public static int compare(Comparable left, Comparable right)(Code)



compare
public static int compare(Comparable[] left, Comparable[] right)(Code)



compare
public static int compare(int left, int right)(Code)



compare
public static int compare(List left, List right)(Code)



compare
public static int compare(Object left, Object right)(Code)



compareIdentity
final public static int compareIdentity(Object left, Object right)(Code)
An optimized comparison that uses identity hash codes to perform the comparison between non- null objects.
Parameters:
  left - The left-hand side of the comparison; may be null.
Parameters:
  right - The right-hand side of the comparison; may benull. 0 if they are the same, -1 if leftis null;1 if right isnull. Otherwise, the left identity hash codeminus the right identity hash code.



diff
public static void diff(Map left, Map right, Set leftOnly, Set different, Set rightOnly)(Code)



diff
public static void diff(Set left, Set right, Set leftOnly, Set rightOnly)(Code)



endsWith
public static boolean endsWith(List left, List right, boolean equals)(Code)



endsWith
public static boolean endsWith(Object[] left, Object[] right, boolean equals)(Code)



equals
public static boolean equals(boolean left, boolean right)(Code)



equals
public static boolean equals(int left, int right)(Code)



equals
public static boolean equals(Object left, Object right)(Code)



equals
final public static boolean equals(Object[] leftArray, Object[] rightArray)(Code)
Tests whether two arrays of objects are equal to each other. The arrays must not be null, but their elements may be null.
Parameters:
  leftArray - The left array to compare; may be null, andmay be empty and may contain null elements.
Parameters:
  rightArray - The right array to compare; may be null, andmay be empty and may contain null elements. true if the arrays are equal length and theelements at the same position are equal; falseotherwise.



getAdapter
public static Object getAdapter(Object sourceObject, Class adapterType)(Code)
If it is possible to adapt the given object to the given type, this returns the adapter. Performs the following checks:
  1. Returns sourceObject if it is an instance of the adapter type.
  2. If sourceObject implements IAdaptable, it is queried for adapters.
  3. If sourceObject is not an instance of PlatformObject (which would have already done so), the adapter manager is queried for adapters
Otherwise returns null.
Parameters:
  sourceObject - object to adapt, or null
Parameters:
  adapterType - type to adapt to a representation of sourceObject that is assignable to theadapter type, or null if no such representation exists



getArrayFromList
public static String[] getArrayFromList(String prop, String separator)(Code)
Returns the result of converting a list of comma-separated tokens into an array. Used as a replacement for String.split(String), to allow compilation against JCL Foundation (bug 80053).
Parameters:
  prop - the initial comma-separated string
Parameters:
  separator - the separator characters the array of string tokens
since:
   3.1



getShellToParentOn
public static Shell getShellToParentOn()(Code)
Return an appropriate shell to parent dialogs on. This will be one of the workbench windows (the active one) should any exist. Otherwise null is returned. the shell to parent on or null if there is noappropriate shell
since:
   3.3



getWorkbenchWindowForShell
public static IWorkbenchWindow getWorkbenchWindowForShell(Shell shellToCheck)(Code)
Return the window for the given shell or the currently active window if one could not be determined.
Parameters:
  shellToCheck - the shell to search on the window for the given shell or the currently active window ifone could not be determined
since:
   3.2



hashCode
public static int hashCode(boolean b)(Code)



hashCode
public static int hashCode(int i)(Code)



hashCode
public static int hashCode(Object object)(Code)



intern
public static String intern(String string)(Code)
Returns an interned representation of the given string
Parameters:
  string - The string to intern The interned string



replaceAll
public static String replaceAll(String src, String find, String replacement)(Code)
Foundation replacement for String.replaceAll(*).
Parameters:
  src - the starting string.
Parameters:
  find - the string to find.
Parameters:
  replacement - the string to replace. The new string.
since:
   3.3



safeCopy
public static Collection safeCopy(Collection collection, Class c)(Code)



safeCopy
public static Collection safeCopy(Collection collection, Class c, boolean allowNullElements)(Code)



safeCopy
public static List safeCopy(List list, Class c)(Code)



safeCopy
public static List safeCopy(List list, Class c, boolean allowNullElements)(Code)



safeCopy
public static Map safeCopy(Map map, Class keyClass, Class valueClass)(Code)



safeCopy
public static Map safeCopy(Map map, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues)(Code)



safeCopy
public static Set safeCopy(Set set, Class c)(Code)



safeCopy
public static Set safeCopy(Set set, Class c, boolean allowNullElements)(Code)



safeCopy
public static SortedMap safeCopy(SortedMap sortedMap, Class keyClass, Class valueClass)(Code)



safeCopy
public static SortedMap safeCopy(SortedMap sortedMap, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues)(Code)



safeCopy
public static SortedSet safeCopy(SortedSet sortedSet, Class c)(Code)



safeCopy
public static SortedSet safeCopy(SortedSet sortedSet, Class c, boolean allowNullElements)(Code)



safeLoadExecutableExtension
public static Object safeLoadExecutableExtension(IConfigurationElement element, String attName, Class classSpec)(Code)
Attempt to load the executable extension from the element/attName. If the load fails or the resulting object is not castable to the provided classSpec (if any) an error is logged and a null is returned.
Parameters:
  element - The IConfigurationElement containing theexecutable extension's specification
Parameters:
  attName - The attribute name of the executable extension
Parameters:
  classSpec - An optional Class defining the typethat the loaded Object must be castable to. This is optional to supportcode where the client has a choice of mutually non-castable types tochoose from. The loaded object which is guaranteed to becastable to the given classSpec or null if a failure occurred



safeString
public static String safeString(String input)(Code)
Ensures that a string is not null. Converts null strings into empty strings, and leaves any other string unmodified. Use this to help wrap calls to methods that return null instead of the empty string. Can also help protect against implementation errors in methods that are not supposed to return null.
Parameters:
  input - input string (may be null) input if not null, or the empty string if input is null



split
public static String[] split(String src, char delim)(Code)
Splits a string at the first occurance of the delimiting char. If the source string is null then so is the result. If the source string is badly formatted then it is returned in the first array entry and the second entry is an empty string.
Parameters:
  src - The string to be split
Parameters:
  delim - The character to split on A two entry string array containing the left/right pair.



startsWith
public static boolean startsWith(List left, List right, boolean equals)(Code)



startsWith
public static boolean startsWith(Object[] left, Object[] right, boolean equals)(Code)



translateString
public static String translateString(ResourceBundle resourceBundle, String key)(Code)



translateString
public static String translateString(ResourceBundle resourceBundle, String key, String string, boolean signal, boolean trim)(Code)



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.