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

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

public class RentTransaction
extends Transaction

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


Field Summary
private  java.util.ArrayList<BarCode> barCodes
          The ArrayList of bar codes for the transaction.
private  java.lang.String cardNumber
          The card number for the transaction.
 
Constructor Summary
RentTransaction()
          Constructor that returns a Rent Transaction with blank values
RentTransaction(java.lang.String line)
          Constructor that assigns values based on the information on the TransactionDB
 
Method Summary
 void addBarCode(BarCode barCode)
          Method that adds a BarCode to the ArrayList of BarCodes
 java.util.ArrayList<BarCode> getBarCodes()
          An accessor method which returns the ArrayList of BarCodes for the transaction.
 void setBarCodes(java.util.ArrayList<BarCode> barCodes)
          An accessor method which sets the ArrayList of BarCodes 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

cardNumber

private java.lang.String cardNumber
The card number for the transaction.


barCodes

private java.util.ArrayList<BarCode> barCodes
The ArrayList of bar codes for the transaction.

Constructor Detail

RentTransaction

public RentTransaction()
Constructor that returns a Rent Transaction with blank values


RentTransaction

public RentTransaction(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

setBarCodes

public void setBarCodes(java.util.ArrayList<BarCode> barCodes)
An accessor method which sets the ArrayList of BarCodes for the transaction.


getBarCodes

public java.util.ArrayList<BarCode> getBarCodes()
An accessor method which returns the ArrayList of BarCodes for the transaction.


addBarCode

public void addBarCode(BarCode barCode)
Method that adds a BarCode to the ArrayList of BarCodes

Parameters:
barCode - BarCode to be added

toString

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

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