|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.inf111.dvdvendor.app.Transaction
public abstract class Transaction
The Transaction abstract class is extended by any class which represents a transaction in our point of sale. This class has been created to simplify the creation of future transaction. In our example, RentTransaction and ReturnTransaction extend this class. The class provides common accessor methods for the fields.
Field Summary | |
---|---|
private java.lang.String |
cardNumber
The card number for the transaction. |
private double |
cost
The cost for the transaction. |
private java.lang.String |
dateTime
The date and time for the transaction. |
Constructor Summary | |
---|---|
Transaction()
|
Method Summary | |
---|---|
static Transaction |
createTransaction(java.lang.String line)
Static method that creates a Rent or a Return Transaction based on the input String that represents a line in the transactionDB file |
java.lang.String |
getCardNumber()
An accessor method which returns the card number for the transaction. |
double |
getCost()
An accessor method which returns the cost for the transaction. |
java.lang.String |
getDateTime()
An accessor method which returns the date and time for the transaction. |
void |
setCardNumber(java.lang.String cardNumber)
An accessor method which sets the card number for the transaction. |
void |
setCost(double cost)
An accessor method which sets the cost for the transaction. |
void |
setDateTime(java.lang.String dateTime)
An accessor method which sets the date and time for the transaction. |
abstract java.lang.String |
toString()
Abstract method to define the toString method in each class that extends this abstract class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String dateTime
private double cost
private java.lang.String cardNumber
Constructor Detail |
---|
public Transaction()
Method Detail |
---|
public void setDateTime(java.lang.String dateTime)
public java.lang.String getDateTime()
public void setCost(double cost)
public double getCost()
public void setCardNumber(java.lang.String cardNumber)
public java.lang.String getCardNumber()
public static Transaction createTransaction(java.lang.String line) throws InvalidBarCodeException
line
- String that represents a line in the TransactionDB file
InvalidBarCodeException
- if the BarCode read is not validpublic abstract java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |