public ArrayList<Transaction> getNextTransaction() throws IOException{
		while (hasMoreTransaction()) {
			while(nextLine.length()== 0){
				nextLine = source.readLine();
			}
			StringTokenizer st = new StringTokenizer(nextLine,"	",false);
			
			String nextToken = st.nextToken();
			
			//add transaction header
			Date d = new Date(System.currentTimeMillis());
			TransactionHeader header = new TransactionHeader(nextToken,d);
			Transaction transaction = new Transaction(header);
			transaction.setHeader(header);
			nextLine = source.readLine();
			//System.out.println(nextLine);
			
			//add transaction items
			while (!nextLine.startsWith("<")){
				st = new StringTokenizer(nextLine,"	",false);
				TransactionItem transItem = new TransactionItem(Integer.parseInt(st.nextToken()),1);
				if (st.hasMoreTokens()){
					transItem.setNumItem(Integer.parseInt(st.nextToken()));
				}
				transaction.addItem(transItem);
				nextLine = source.readLine();
				//System.out.println(nextLine);
			}
			
			//add payment
			st = new StringTokenizer(nextLine,"<>$	",false);
			String paymentMethod = st.nextToken();
			Payment payment= null;
			switch (paymentMethod){
			case "CASH":
				payment = new CashPayment(Double.parseDouble(st.nextToken()));
				break;
			case "CHECK":
				payment = new CheckPayment(Double.parseDouble(st.nextToken()));
				break;
			case "Credit":
				payment = new CreditPayment(Double.parseDouble(st.nextToken()));
				break;
			}
			transaction.addPayment(payment);
			this.transactions.add(transaction);
		}
		return transactions;
	}