Class StackLLTimer

java.lang.Object
  extended byStackLLTimer

public class StackLLTimer
extends java.lang.Object

This class generates elementary timing results for the StackLL class.


Constructor Summary
StackLLTimer()
           
 
Method Summary
static void main(java.lang.String[] args)
          The main method creates a StackAL class, fills it with a maximum number of precreated Integers, and empties it.
static java.lang.String paddedFormat(long k, int space)
          Converts an integer to a string with enough leading blanks to fill a space of the specified size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackLLTimer

public StackLLTimer()
Method Detail

paddedFormat

public static java.lang.String paddedFormat(long k,
                                            int space)
Converts an integer to a string with enough leading blanks to fill a space of the specified size.

Parameters:
k - the integer to be formatted
space - the size of the space to be filled
Returns:
a formatted string with the integer right justified in the specified space.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
The main method creates a StackAL class, fills it with a maximum number of precreated Integers, and empties it. It does these operations in a loop in order to smooth out the variations due to the coarseness of a millisecond timer.

Parameters:
args - an array of strings which can provide the following optional parameters:
  1. dataSize: the maximum number of items to be placed in the stack, default is 1000
  2. maxLoops: the nuumber of times the stack is created, filled, and emptied, default is 1000
  3. the name of an output file
Throws:
java.io.IOException