phonebill.phonelog
Class PhoneBill

java.lang.Object
  |
  +--phonebill.phonelog.PhoneBill

public class PhoneBill
extends java.lang.Object

This class is a standalone program capable of generating a phone bill based on the given command line parameters and (eventually) a configuration file.


Field Summary
protected  boolean error
           
protected  boolean help
           
protected  PhoneLogParser logParser
           
protected  Parameters params
           
protected static PhonePrice prices
           
protected  boolean verbose
           
static java.lang.String version
           
 
Constructor Summary
PhoneBill()
           
PhoneBill(java.lang.String[] argv)
           
 
Method Summary
protected  void dumpConfig()
           
protected  boolean getParms(java.lang.String[] argv)
          Processes parameters given at the command line.
static PhonePrice getPhonePriceInstance()
           
static long getUsedMemory()
           
protected  void initParms()
          Set the parameter properties.
protected  boolean loadDefaultParmsAndValidate()
          Validate the values of parameters.
static void main(java.lang.String[] argv)
           
protected  boolean parseConfigFile()
          Read the config file and set default values for the remaining parameters.
protected  void printHelp()
           
protected  void printUse()
           
 void run()
           
static void setDefaultPhonePrice(PhonePrice newPrice)
           
protected  void testPrices()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version

prices

protected static PhonePrice prices

logParser

protected PhoneLogParser logParser

params

protected Parameters params

verbose

protected boolean verbose

help

protected boolean help

error

protected boolean error
Constructor Detail

PhoneBill

public PhoneBill()

PhoneBill

public PhoneBill(java.lang.String[] argv)
Method Detail

run

public void run()

testPrices

protected void testPrices()

main

public static void main(java.lang.String[] argv)

getParms

protected boolean getParms(java.lang.String[] argv)
Processes parameters given at the command line. Allowed parameters: -c file The config file to use (default is "PhoneBill.conf" in the current directory) -d dir Directory where logfiles can be found -s date The date ([YY]YYMMDD) for which to begin with -e date The date ([YY]YYMMDD) for which to end with -o file The name of the output file (possibly with complete path) -V Run in verbose mode -Dn Run in debug level n [0..5]

initParms

protected void initParms()
Set the parameter properties.

parseConfigFile

protected boolean parseConfigFile()
Read the config file and set default values for the remaining parameters.

loadDefaultParmsAndValidate

protected boolean loadDefaultParmsAndValidate()
Validate the values of parameters.

dumpConfig

protected void dumpConfig()

printUse

protected void printUse()

printHelp

protected void printHelp()

getPhonePriceInstance

public static PhonePrice getPhonePriceInstance()

setDefaultPhonePrice

public static void setDefaultPhonePrice(PhonePrice newPrice)

getUsedMemory

public static long getUsedMemory()