type.lib
Class Trx

java.lang.Object
  extended by type.lib.Trx
All Implemented Interfaces:
java.io.Serializable

public class Trx
extends java.lang.Object
implements java.io.Serializable

This class encapsulates a transaction. A transaction has a date, a code, a reference number, a Contact, an Item, a quantity, and an amount.

This class aggregates Date, Contact, and Item via a regular aggregation, not a composition.

Version:
7.0 - Summer 2010
Author:
H. Roumani, roumani@cse.yorku.ca
See Also:
Serialized Form

Constructor Summary
Trx(java.util.Date date, java.lang.String code, java.lang.String ref, Contact contact, Item item, int qty, double amount)
          Construct a transaction having the passed fields.
 
Method Summary
 double getAmount()
          Determine the amount of this transaction
 java.lang.String getCode()
          Determine the code of this transaction
 Contact getContact()
          Determine the contact of this transaction
 java.util.Date getDate()
          Determine the date of this transaction
 Item getItem()
          Determine the item of this transaction
 int getQty()
          Determine the quantity of this transaction
 java.lang.String getRef()
          Determine the reference of this transaction
 java.lang.String toString()
          Construct a string representation of this transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trx

public Trx(java.util.Date date,
           java.lang.String code,
           java.lang.String ref,
           Contact contact,
           Item item,
           int qty,
           double amount)
Construct a transaction having the passed fields.

Parameters:
date - transaction date.
code - transaction code.
ref - transaction reference.
contact - transaction contact.
item - transaction item.
qty - transaction quantity.
amount - transaction amount.
Method Detail

getDate

public java.util.Date getDate()
Determine the date of this transaction

Returns:
the date of this transaction.

getCode

public java.lang.String getCode()
Determine the code of this transaction

Returns:
the code of this transaction.

getRef

public java.lang.String getRef()
Determine the reference of this transaction

Returns:
the reference of this transaction.

getContact

public Contact getContact()
Determine the contact of this transaction

Returns:
the contact of this transaction.

getItem

public Item getItem()
Determine the item of this transaction

Returns:
the item of this transaction.

getQty

public int getQty()
Determine the quantity of this transaction

Returns:
the quantity of this transaction.

getAmount

public double getAmount()
Determine the amount of this transaction

Returns:
the amount of this transaction.

toString

public java.lang.String toString()
Construct a string representation of this transaction.

Overrides:
toString in class java.lang.Object
Returns:
the string: "TRX code=xxx, date=ddd", where xxx is the transaction code and ddd is its date.


Java by Abstraction: A Client-View Approach