jfreerails.util
Class Utils

java.lang.Object
  extended by jfreerails.util.Utils

public class Utils
extends java.lang.Object

A bunch of static methods.

Author:
Luke

Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String capitalizeEveryWord(java.lang.String str)
           
static java.io.Serializable cloneBySerialisation(java.io.Serializable m)
           
static boolean equal(java.lang.Object a, java.lang.Object b)
          Returns true if the objects are equal or both null, otherwise returns false.
static boolean equalsBySerialization(java.io.Serializable a, java.io.Serializable b)
           
static java.lang.String findConstantFieldName(java.lang.Object o)
           
static int hypotenuse(int a, int b)
           
static double solveQuadratic(double a, double b, double c)
          Returns the largest solution of the quadratic equation ax2 + bx + c = 0.
static void write(java.io.Serializable m, java.lang.String fileName)
          Used when debugging.
private static byte[] write2ByteArray(java.io.Serializable m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

equalsBySerialization

public static boolean equalsBySerialization(java.io.Serializable a,
                                            java.io.Serializable b)

write

public static void write(java.io.Serializable m,
                         java.lang.String fileName)
Used when debugging.


cloneBySerialisation

public static java.io.Serializable cloneBySerialisation(java.io.Serializable m)

write2ByteArray

private static byte[] write2ByteArray(java.io.Serializable m)

capitalizeEveryWord

public static java.lang.String capitalizeEveryWord(java.lang.String str)

findConstantFieldName

public static java.lang.String findConstantFieldName(java.lang.Object o)

solveQuadratic

public static double solveQuadratic(double a,
                                    double b,
                                    double c)
                             throws java.lang.IllegalArgumentException
Returns the largest solution of the quadratic equation ax2 + bx + c = 0.

Throws:
java.lang.IllegalArgumentException - if a == 0
java.lang.IllegalArgumentException - if (b * b - 4 * a * c) < 0

hypotenuse

public static int hypotenuse(int a,
                             int b)

equal

public static boolean equal(java.lang.Object a,
                            java.lang.Object b)
Returns true if the objects are equal or both null, otherwise returns false. Does not throw null pointer exceptions when either of the objects is null.