Class ItemTracking

java.lang.Object
  |
  +--ItemTracking

public class ItemTracking
extends java.lang.Object

This item tracking program reads in a number of library items where each item description contains a call number, item cost, usage value, item type, and an availability value. The usage value is how often the item is used. The availability value is dependent on the type of the library item. The output is two sorted lists: the first is a list of items currently in the library or on-loan, but not lost and the second is a sorted list of missing library items, the replacement cost of the item to the library; and the overall cost of the missing items.

Version:
FINAL 17-OCT-2003
Author:
Ned Martin 40529927

Field Summary
static LibraryItemList libraryItems
          Linked list to hold library items.
 
Constructor Summary
ItemTracking()
           
 
Method Summary
static void main(java.lang.String[] args)
          Run read and print methods.
private static void parse(java.lang.String line)
          Parse input.
private static void print()
          Print item information.
private static void read()
          Read from standard input.
private static LibraryItem returnType(java.lang.String type, java.lang.String callNo, int itemCost, LibraryItem libraryItem)
          Parse item type and create library items based on type
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

libraryItems

public static LibraryItemList libraryItems
Linked list to hold library items.
Constructor Detail

ItemTracking

public ItemTracking()
Method Detail

main

public static void main(java.lang.String[] args)
Run read and print methods.

read

private static void read()
Read from standard input.

parse

private static void parse(java.lang.String line)
Parse input. Accept a line, parses it, determines type of book, create a new LibraryList object, insert data into it, add object to linked list in a sorted manner, and set usage and availability information

returnType

private static LibraryItem returnType(java.lang.String type,
                                      java.lang.String callNo,
                                      int itemCost,
                                      LibraryItem libraryItem)
Parse item type and create library items based on type
Returns:
object depending on type of library item

print

private static void print()
Print item information.