use of com.google.spanner.v1.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 com.google.spanner.v1.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;
}
Aggregations