|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.inf111.dvdvendor.app.Utils
public class Utils
This class contains constants, enums, and static methods that are commonly used in the DVD Vendor System.
Nested Class Summary | |
---|---|
static class |
Utils.genre
Enumeration that represents the different genres the DVD can belong to. |
Field Summary | |
---|---|
static double |
lateFee
The double representation for the late fee to be charged per DVD. |
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static java.lang.String |
getBarCodeFromDescription(java.lang.String description)
This utility method returns the String that represents the BarCode from a String that has both the BarCode and the Title of the DVD. |
static java.lang.String[] |
getBarCodesAndTitlesFromProductDB()
This utility method returns an array of String with the Bar Codes and Titles from the Product Database |
static java.lang.String |
getFieldBeforeSymbol(java.lang.String line,
java.lang.String symbol)
This utility method returns the String that represents the field between the beginning of the line and the symbol. |
static java.lang.String |
getLineAfterSymbol(java.lang.String line,
java.lang.String symbol)
This utility method returns the String that represents the line after the indicated symbol. |
static long |
getSecondsDifference(java.lang.String start,
java.lang.String end)
A utility method which calculates the difference in seconds between two date times |
static boolean |
isNumber(java.lang.String str)
This utility method returns true if the characters in the String are all numbers, else it returns false |
static void |
printDB(java.util.Hashtable<java.lang.String,Product> itemsInDB)
A utility method which prints the contents of the ProductDB to System.out |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double lateFee
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static void printDB(java.util.Hashtable<java.lang.String,Product> itemsInDB)
itemsInDB
- The DB Hashtable, which should be accessed using productDB.listAll()public static java.lang.String[] getBarCodesAndTitlesFromProductDB() throws java.lang.Exception
java.lang.Exception
- if there is any problem instantiating the ProductDBpublic static boolean isNumber(java.lang.String str)
public static java.lang.String getBarCodeFromDescription(java.lang.String description)
description
- String showed in the ComboBox in the format barcode - titlepublic static java.lang.String getFieldBeforeSymbol(java.lang.String line, java.lang.String symbol)
line
- String that represents a line in the Transaction filesymbol
- Stop symbol used to delimit fields in the Transaction filepublic static java.lang.String getLineAfterSymbol(java.lang.String line, java.lang.String symbol)
line
- String that represents a line in the Transaction filesymbol
- Stop symbol used to delimit fields in the Transaction filepublic static long getSecondsDifference(java.lang.String start, java.lang.String end) throws java.text.ParseException
start
- The start date and timeend
- The end date and time
java.text.ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |