net.sf.paperclips.internal
Class Util

java.lang.Object
  extended by net.sf.paperclips.internal.Util

public class Util
extends java.lang.Object

General use convenience methods: null checking, equality


Constructor Summary
Util()
           
 
Method Summary
static boolean equal(double left, double right)
          Returns whether the arguments are equal.
static boolean equal(java.lang.Object left, java.lang.Object right)
          Returns whether the arguments are equal.
static void noNulls(java.util.List list)
          Triggers a SWT.ERROR_NULL_ARGUMENT exception if the argument or any of its elements is null.
static void noNulls(java.lang.Object[] objs)
          Triggers a SWT.ERROR_NULL_ARGUMENT exception if the argument or any of its elements is null.
static void notNull(java.lang.Object obj)
          Triggers a SWT.ERROR_NULL_ARGUMENT exception if the argument is null.
static void notNull(java.lang.Object o1, java.lang.Object o2)
          Triggers a SWT.ERROR_NULL_ARGUMENT exception if any argument is null.
static void notNull(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
          Triggers a SWT.ERROR_NULL_ARGUMENT exception if any argument is null.
static boolean sameClass(java.lang.Object left, java.lang.Object right)
          Returns whether the objects are of the same class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

sameClass

public static boolean sameClass(java.lang.Object left,
                                java.lang.Object right)
Returns whether the objects are of the same class.

Parameters:
left - object to test
right - object to test
Returns:
whether the objects are of the same class.

equal

public static boolean equal(java.lang.Object left,
                            java.lang.Object right)
Returns whether the arguments are equal.

Parameters:
left - object to test
right - object to test
Returns:
whether the arguments are equal.

equal

public static boolean equal(double left,
                            double right)
Returns whether the arguments are equal.

Parameters:
left - double value to test
right - double value to test
Returns:
whether the arguments are equal.

noNulls

public static void noNulls(java.util.List list)
Triggers a SWT.ERROR_NULL_ARGUMENT exception if the argument or any of its elements is null.

Parameters:
list - a list to test for null elements.

noNulls

public static void noNulls(java.lang.Object[] objs)
Triggers a SWT.ERROR_NULL_ARGUMENT exception if the argument or any of its elements is null.

Parameters:
objs - an array to test for null elements.

notNull

public static void notNull(java.lang.Object obj)
Triggers a SWT.ERROR_NULL_ARGUMENT exception if the argument is null.

Parameters:
obj - the object to test for null.

notNull

public static void notNull(java.lang.Object o1,
                           java.lang.Object o2)
Triggers a SWT.ERROR_NULL_ARGUMENT exception if any argument is null.

Parameters:
o1 - an object to test for null.
o2 - an object to test for null.

notNull

public static void notNull(java.lang.Object o1,
                           java.lang.Object o2,
                           java.lang.Object o3)
Triggers a SWT.ERROR_NULL_ARGUMENT exception if any argument is null.

Parameters:
o1 - an object to test for null.
o2 - an object to test for null.
o3 - an object to test for null.