org.browsecode.helpers
Class MiscMethods

java.lang.Object
  extended by org.browsecode.helpers.MiscMethods

public class MiscMethods
extends java.lang.Object


Constructor Summary
MiscMethods()
           
 
Method Summary
static boolean areEqual(java.lang.Object objA, java.lang.Object objB)
          Checks whether two objects are equal, including checking for nulls.
static void copyTimeOfDayFromTo(java.util.Calendar time, java.util.Calendar day)
           
static void copyTimeOfDayFromTo(java.util.Date time, java.util.Calendar day)
          Copies the time from "time" into the passed in calendar, "day".
static int getComponentIndex(java.awt.Container container, java.awt.Component c)
          Returns the index of the specified component.
static javax.swing.JTextPane getNonEditableHTMLArea(java.lang.String text)
           
static javax.swing.JTextArea getNonEditableTextArea(java.lang.String text)
           
static java.lang.String getThNumberEnding(int num)
          Pass in "1", "2", or "3" and get "1st", "2nd", "3rd", etc.
static
<T> java.util.Vector<T>
randomizeVector(java.util.Vector<T> vector)
           
static boolean stringNonBlank(java.lang.String strA)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiscMethods

public MiscMethods()
Method Detail

getComponentIndex

public static int getComponentIndex(java.awt.Container container,
                                    java.awt.Component c)
Returns the index of the specified component.
(This isn't implemented in Container, strangely enough, so we have it as a utility function.)

Parameters:
c - the Component to find
Returns:
an integer indicating the component's position, where 0 is first

getNonEditableTextArea

public static javax.swing.JTextArea getNonEditableTextArea(java.lang.String text)

getNonEditableHTMLArea

public static javax.swing.JTextPane getNonEditableHTMLArea(java.lang.String text)

getThNumberEnding

public static java.lang.String getThNumberEnding(int num)
Pass in "1", "2", or "3" and get "1st", "2nd", "3rd", etc.


areEqual

public static boolean areEqual(java.lang.Object objA,
                               java.lang.Object objB)
Checks whether two objects are equal, including checking for nulls.

Returns:

stringNonBlank

public static boolean stringNonBlank(java.lang.String strA)

randomizeVector

public static <T> java.util.Vector<T> randomizeVector(java.util.Vector<T> vector)

copyTimeOfDayFromTo

public static void copyTimeOfDayFromTo(java.util.Date time,
                                       java.util.Calendar day)
Copies the time from "time" into the passed in calendar, "day".

Parameters:
time -
day -

copyTimeOfDayFromTo

public static void copyTimeOfDayFromTo(java.util.Calendar time,
                                       java.util.Calendar day)