utility
Class Stuff

java.lang.Object
  extended by utility.Stuff

public class Stuff
extends java.lang.Object

this class holds frequently used helper functions


Constructor Summary
Stuff()
           
 
Method Summary
static void addGB(java.awt.Container cont, java.awt.Component comp, java.awt.GridBagConstraints gbc, int x, int y)
           
static void addGB(java.awt.Container cont, java.awt.Component comp, java.awt.GridBagConstraints gbc, int x, int y, int width, int height)
           
static void addGB(java.awt.Container cont, java.awt.Component comp, int x, int y)
           
static void addGB(java.awt.Container cont, java.awt.Component comp, int x, int y, int width, int height)
           
static void bubbleSort(java.lang.Object[] objs, double[] index)
          sorts an Object[] according to an double[] of indices.
static void bubbleSort(java.lang.Object[] objs, int[] index)
          sorts an Object[] according to an int[] of indices.
static void clearLine(char[] line)
          Sets all elements of a char[] to ' '
static void fillLine(char[] line, java.lang.String s, int offset)
          Sets the elements of a char[] to the char's in a String starting at offset
static double getDoubleFromUser(java.lang.String message, double min, double max)
          Prompts the user for an double between min and max
static int getIntFromUser(java.lang.String message, int min, int max)
          Prompts the user for an integer between min and max
static int getIntFromUser(java.lang.String message, int min, int max, java.lang.String[] options)
          Prompts the user for an integer between min and max.
static void makeHeap(double[] index, java.lang.Object[] obj)
          turns an double[] into a tree (still a double[])
static boolean member(java.lang.String item, java.lang.String[] list)
          Returns true if item is a memeber of list
static void pauseForUser()
          Waits for the user to press enter
static java.lang.String prompt(java.lang.String message)
          Displays a message and waits for user keyboard input
static double roundToSigFigs(double d, int sigFigs)
          rounds of a number to a given number of places
static WhatData setUpWD(java.sql.Connection con)
          basic set up
static void sift(double[] index, int indexSize, int node, java.lang.Object[] obj)
          orders the tree appropriatly
static void sortHeap(double[] index, java.lang.Object[] obj)
           
static java.lang.String[] split(java.lang.String sen)
          Converts a ' ' or ',' seperated list (String) into an array (String[])
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stuff

public Stuff()
Method Detail

addGB

public static void addGB(java.awt.Container cont,
                         java.awt.Component comp,
                         java.awt.GridBagConstraints gbc,
                         int x,
                         int y)

addGB

public static void addGB(java.awt.Container cont,
                         java.awt.Component comp,
                         java.awt.GridBagConstraints gbc,
                         int x,
                         int y,
                         int width,
                         int height)

addGB

public static void addGB(java.awt.Container cont,
                         java.awt.Component comp,
                         int x,
                         int y)

addGB

public static void addGB(java.awt.Container cont,
                         java.awt.Component comp,
                         int x,
                         int y,
                         int width,
                         int height)

roundToSigFigs

public static double roundToSigFigs(double d,
                                    int sigFigs)
rounds of a number to a given number of places


bubbleSort

public static void bubbleSort(java.lang.Object[] objs,
                              int[] index)
sorts an Object[] according to an int[] of indices. the Object[] is directly affected upon return.


bubbleSort

public static void bubbleSort(java.lang.Object[] objs,
                              double[] index)
sorts an Object[] according to an double[] of indices. the Object[] is directly affected upon return.


sift

public static void sift(double[] index,
                        int indexSize,
                        int node,
                        java.lang.Object[] obj)
orders the tree appropriatly


makeHeap

public static void makeHeap(double[] index,
                            java.lang.Object[] obj)
turns an double[] into a tree (still a double[])


sortHeap

public static void sortHeap(double[] index,
                            java.lang.Object[] obj)

setUpWD

public static WhatData setUpWD(java.sql.Connection con)
basic set up


clearLine

public static void clearLine(char[] line)
Sets all elements of a char[] to ' '


fillLine

public static void fillLine(char[] line,
                            java.lang.String s,
                            int offset)
Sets the elements of a char[] to the char's in a String starting at offset


split

public static java.lang.String[] split(java.lang.String sen)
Converts a ' ' or ',' seperated list (String) into an array (String[])


prompt

public static java.lang.String prompt(java.lang.String message)
Displays a message and waits for user keyboard input


getIntFromUser

public static int getIntFromUser(java.lang.String message,
                                 int min,
                                 int max)
Prompts the user for an integer between min and max


getIntFromUser

public static int getIntFromUser(java.lang.String message,
                                 int min,
                                 int max,
                                 java.lang.String[] options)
                          throws java.lang.Exception
Prompts the user for an integer between min and max. Throws an Exception when the input matches an element of options.

Throws:
java.lang.Exception

getDoubleFromUser

public static double getDoubleFromUser(java.lang.String message,
                                       double min,
                                       double max)
Prompts the user for an double between min and max


member

public static boolean member(java.lang.String item,
                             java.lang.String[] list)
Returns true if item is a memeber of list


pauseForUser

public static void pauseForUser()
Waits for the user to press enter