Package com.google.gdata.data.finance

Examples of com.google.gdata.data.finance.TransactionData


   * @param transactionEntry The transaction entry of interest
   */
  private static void printTransactionEntry(TransactionEntry transactionEntry) {
    System.out.println("\nTransaction Entry\n-----------------");
    printBasicEntryDetails(transactionEntry);
    TransactionData transactionData = transactionEntry.getTransactionData();
    System.out.println("\tTransaction Data:");
    System.out.println("\t\tType: " +
                       (transactionData.getType() == null ? "no type" : transactionData.getType()));
    System.out.println("\t\tDate: " +
                       (transactionData.getDate() == null ? "no date" : transactionData.getDate()));
    System.out.printf("\t\tShares: %.2f\n", transactionData.getShares());
    if (transactionData.getPrice() == null) {
      System.out.println("\t\tPrice not specified");
    } else {
      for (int i = 0; i < transactionData.getPrice().getMoney().size(); i++) {
        Money m = transactionData.getPrice().getMoney().get(i);
        System.out.printf("\t\tThis transaction had a unit price of %.2f %s.\n",
                          m.getAmount(), m.getCurrencyCode());
      }
    }
    if (transactionData.getCommission() == null) {
      System.out.println("\t\tCommission not specified");
    } else {
      for (int i = 0; i < transactionData.getCommission().getMoney().size(); i++) {
        Money m = transactionData.getCommission().getMoney().get(i);
        System.out.printf("\t\tThis transaction had a commission of %.2f %s.\n",
                          m.getAmount(), m.getCurrencyCode());
      }
    }
    System.out.println("\t\tNotes: " +
                       (null == transactionData.getNotes() ? "none" : transactionData.getNotes()));
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.finance.TransactionData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.