|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.util.Utilities
public class Utilities
Constructor Summary | |
---|---|
Utilities()
|
Method Summary | |
---|---|
static boolean |
arrayContainsElement(java.lang.Object[] anArray,
java.lang.Object anElement)
Returns "true" if the passed in array contains the passed in element. |
static java.lang.String |
currentTimeString(boolean useTwentyFourHourTime,
boolean showAMPMIndicator)
Can return a string of the form "5:35:09pm", as opposed to "17:35:09" If "useTwentyFourHourTime" is "true", returns time in the form "17:35:09" If "showAMPMIndicator" is "true" it will include the "am" or "pm" text, otherwise it won't. |
static boolean |
endsWithIgnoringCase(java.lang.String aString,
java.lang.String possibleEnding)
Case insensitive String.endsWith() |
static java.lang.Object |
getImplFromServices(java.lang.String interfaceClassName)
This method tries to load the resource META-INF/services/<interfaceClassName> , where
<interfaceClassName> is the argument to this
method. |
static java.lang.String |
getPackageName(java.lang.Class aClass)
|
static java.util.ResourceBundle |
getResourceBundle(java.lang.String baseName)
This method is a simpler alternative to ResourceLoader.loadResourceBundle. |
static java.awt.Component |
getTopLevelParent(java.awt.Component aComponent)
Uses "getParent()" to find this Component's top-level ancestor. |
static java.lang.String |
removeAllWhitespace(java.lang.String aString)
Removes leading, trailing, and internal whitespace from the passed-in string. |
static java.lang.String |
stringFromVector(java.util.Vector aVector,
java.lang.String delimiter)
Creates a String by combining the elements of aVector. |
static java.util.Vector |
vectorFromArray(java.lang.Object[] anArray)
Convert an Array into a Vector. |
static java.util.Vector |
vectorFromString(java.lang.String input,
java.lang.String delimiter)
Take the given string and chop it up into a series of strings on "delimiter" boundries. |
static boolean |
vectorsAreEqual(java.util.Vector vectorOne,
java.util.Vector vectorTwo)
Amazing that "Vector" does not override Object's "equals()" method to do this itself! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utilities()
Method Detail |
---|
public static java.util.Vector vectorFromString(java.lang.String input, java.lang.String delimiter)
public static java.lang.String stringFromVector(java.util.Vector aVector, java.lang.String delimiter)
public static java.util.Vector vectorFromArray(java.lang.Object[] anArray)
public static boolean vectorsAreEqual(java.util.Vector vectorOne, java.util.Vector vectorTwo)
public static boolean arrayContainsElement(java.lang.Object[] anArray, java.lang.Object anElement)
public static java.lang.String removeAllWhitespace(java.lang.String aString)
public static java.lang.String currentTimeString(boolean useTwentyFourHourTime, boolean showAMPMIndicator)
public static java.awt.Component getTopLevelParent(java.awt.Component aComponent)
public static java.lang.String getPackageName(java.lang.Class aClass)
aClass
- the class whose package name should be returned
public static java.util.ResourceBundle getResourceBundle(java.lang.String baseName)
baseName
- the fully qualified name of the resource bundle,
sans ".properties
" suffix. For example, a
valid value for baseName would be
com.sun.jag.apps.spex.util.SUResources
when the
properties file SUResources.properties
is in the
classpath under the directory
com/sun/jag/apps/spex/util
.
public static boolean endsWithIgnoringCase(java.lang.String aString, java.lang.String possibleEnding)
public static java.lang.Object getImplFromServices(java.lang.String interfaceClassName)
This method tries to load the resource
META-INF/services/<interfaceClassName>
, where
<interfaceClassName>
is the argument to this
method. If the resource is found, interpret it as a
Properties
file and read out its first line.
Interpret the first line as the fully qualified class name of a
class that implements interfaceClassName
. The named
class must have a public no-arg constructor.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |