use of edu.princeton.cs.algs4.Transaction in project algorithms-sedgewick-wayne by reneargento.
the class Exercise22_TransactionSortTest method main.
public static void main(String[] args) {
String transactionFilePath = args[0];
Transaction[] transactions = readAllTransactions(transactionFilePath);
Arrays.sort(transactions);
for (Transaction transaction : transactions) {
StdOut.println(transaction);
}
}
use of edu.princeton.cs.algs4.Transaction in project algorithms-sedgewick-wayne by reneargento.
the class Exercise22_TransactionSortTest method readAllTransactions.
public static Transaction[] readAllTransactions(String fileName) {
In in = new In(fileName);
Queue<Transaction> queue = new Queue<>();
while (!in.isEmpty()) {
queue.enqueue(new Transaction(in.readLine()));
}
int queueSize = queue.size();
Transaction[] transactions = new Transaction[queueSize];
for (int i = 0; i < queueSize; i++) {
transactions[i] = queue.dequeue();
}
return transactions;
}
use of edu.princeton.cs.algs4.Transaction in project algorithms-sedgewick-wayne by reneargento.
the class Exercise17 method main.
public static void main(String[] args) {
String transactionFilePath = args[0];
Transaction[] transactions = readAllTransactions(transactionFilePath);
for (Transaction transaction : transactions) {
StdOut.println(transaction);
}
}
use of edu.princeton.cs.algs4.Transaction in project algorithms-sedgewick-wayne by reneargento.
the class Exercise17 method readAllTransactions.
public static Transaction[] readAllTransactions(String fileName) {
In in = new In(fileName);
Queue<Transaction> queue = new Queue<>();
while (!in.isEmpty()) {
queue.enqueue(new Transaction(in.readLine()));
}
int queueSize = queue.size();
Transaction[] transactions = new Transaction[queueSize];
for (int i = 0; i < queueSize; i++) {
transactions[i] = queue.dequeue();
}
return transactions;
}
use of edu.princeton.cs.algs4.Transaction in project algorithms-sedgewick-wayne by reneargento.
the class Exercise19_2_Parsing method main.
public static void main(String[] args) {
Date date = new Date(8, 5, 2016);
Exercise19_2_Parsing transaction = new Exercise19_2_Parsing("Turing", date, 22.10);
StdOut.println(transaction);
StdOut.println("Expected: Turing spent 22.1 on 8/5/2016");
}
Aggregations