edu.uci.ics.inf111.dvdvendor.app
Class ReturnTransaction

java.lang.Object
  extended by edu.uci.ics.inf111.dvdvendor.app.Transaction
      extended by edu.uci.ics.inf111.dvdvendor.app.ReturnTransaction

public class ReturnTransaction
extends Transaction

This class represents a Return Transaction in the point of sale. It contains the main characteristics of a Return Transaction and it extends the abstract class Transaction


Field Summary
private  BarCode barCode
          The bar code for the transaction.
 
Constructor Summary
ReturnTransaction()
          Constructor that returns a Return Transaction with blank values
ReturnTransaction(java.lang.String line)
          Constructor that assigns values based on the information on the TransactionDB
 
Method Summary
 BarCode getBarCode()
          An accessor method which returns the BarCode for the transaction.
 void setBarCode(BarCode barCode)
          An accessor method which sets the BarCode for the transaction.
 java.lang.String toString()
          Implementation of the abstract method to define the toString action.
 
Methods inherited from class edu.uci.ics.inf111.dvdvendor.app.Transaction
createTransaction, getCardNumber, getCost, getDateTime, setCardNumber, setCost, setDateTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

barCode

private BarCode barCode
The bar code for the transaction.

Constructor Detail

ReturnTransaction

public ReturnTransaction()
Constructor that returns a Return Transaction with blank values


ReturnTransaction

public ReturnTransaction(java.lang.String line)
                  throws InvalidBarCodeException
Constructor that assigns values based on the information on the TransactionDB

Parameters:
line - String that represents a line in the TransactionDB file
Throws:
InvalidBarCodeException - if the BarCode read is not valid
Method Detail

setBarCode

public void setBarCode(BarCode barCode)
An accessor method which sets the BarCode for the transaction.


getBarCode

public BarCode getBarCode()
An accessor method which returns the BarCode for the transaction.


toString

public java.lang.String toString()
Implementation of the abstract method to define the toString action. This method will take the values of the ReturnTransaction class and will concatenate them in a String with the expected format in the Transaction database. Format: TypeOfTransaction|DateTime|Cost|CardNumber|BarCode|

Specified by:
toString in class Transaction
Returns:
String Represents the transaction to be stored in the Transaction database.