Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.pjsofts.eurobudget.beans
Class Account  view Account download Account.java

java.lang.Object
  extended bycom.pjsofts.eurobudget.beans.Account
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
AccountCodevi, AccountLivret, AccountPEL, AccountPorteMonnaie

public class Account
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Account, Bean Compte courant bancaire Try to keep the minimum of methods. All convenient methods should be written as AccountLib static methods. (As we save it as bean, try to minimize change and size)


Field Summary
private  AccountGroup accountGroup
          Group of account
private  Bank bank
           
private  java.util.Currency ccy
           
private  java.lang.String comment
          comment
private  java.util.Date creationDate
          Holds value of property creationDate.
private  double creditDayTotal
          Today credit total
private  double ctotal
          Final Credit total
private  double dayTotal
          Today total
private  double debitDayTotal
          Today debit total
private  double dtotal
          Final Debit total
static int FLAG_ENDED
          compte cloturé (can't add anymore txn)
static int FLAG_FAVORITE
           
static int FLAG_O1
           
static int FLAG_O2
           
static int FLAG_O3
           
static int FLAG_O4
           
static int FLAG_O5
           
static int FLAG_O6
           
static int FLAG_TVA
           
private  java.util.BitSet flags
          Flags ...
private static java.util.ResourceBundle i18n
          resource for i18n
private  java.lang.String iban
          Identification internationale
private  java.lang.String id
          Holds value of property id.
private  double initialAmount
          solde initial du compte
private  java.util.Date lastBalancedDate
          dernier rapprochement
private  java.util.Date lastModificationDate
          derniere modification
private  double maxAmount
           
private  double minAmount
           
private  java.lang.String name
           
private  java.lang.String refs
          Reference bancaire
private static long serialVersionUID
          serialization trick to be compatible with older implementation ,interoperability
private  double total
          Final total
private  java.util.List txns
          List of Transactions can't be null ??? Sort per Date in chronological order, cause 1)normal view 2)allow to compute sum on range of date -)when saved/exported on file, the sort is not reneeded -)allow to compute faster the balande for one specific day Collections.sort(txns,Comparator); binarySearch==> easy even with List
 
Constructor Summary
Account()
           
Account(java.lang.String id, java.lang.String name, Bank bank, java.util.Date start)
           
 
Method Summary
 int addTransaction(Transaction t)
          in right place in the list warning date may be null !! (virement) do nothing special for virement (use addVirement or addTransactionAndRelated instead)
 int addTransactionAndRelated(Transaction t)
          in right place in the list warning date may be null !! (virement) different of addTransaction because it manages virement
 int addVirement(Virement v)
          in right place in the list warning date may be null !! (virement) special for virement insert also the related ...
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean contains(Transaction t)
           
 AccountGroup getAccountGroup()
          Getter for property accountGroup.
 Bank getBank()
          Getter for property bank.
 java.util.Currency getCcy()
          Getter for property ccy.
 java.lang.String getComment()
          Getter for property comment.
 java.util.Date getCreationDate()
          Getter for property creationDate.
 double getCreditDayTotal()
           
 double getCtotal()
          Getter for property ctotal.
 double getDayTotal()
          Getter for property dtotal.
 double getDebitDayTotal()
           
 double getDtotal()
          Getter for property dtotal.
 java.util.BitSet getFlags()
          Getter for property flags.
 java.lang.String getIban()
          Getter for property iban.
 java.lang.String getId()
          Getter for property id.
 double getInitialAmount()
          Getter for property initialAmount.
 java.util.Date getLastBalancedDate()
          Getter for property lastBalancedDate.
 java.util.Date getLastModificationDate()
          Getter for property lastModificationDate.
 double getMaxAmount()
          Getter for property maxAmount.
 double getMinAmount()
          Getter for property minAmount.
 java.lang.String getName()
          Getter for property name.
 java.lang.String getRefs()
          Getter for property refs.
 double getTotal()
          Getter for property total.
 java.util.List getTxns()
          Getter for property txns.
 boolean isEqual(java.lang.String key)
           
 boolean isFlagSet(int flag)
          don't use with flag none
 void removeAllTxnWithRelated()
          used just before removing the account for example could be called removeAllTxnWithRelated
 void removeTransaction(Transaction t)
          remove the transaction from the list of this account, (do nothing special on virement)
 void removeTransactionAndRelated(int index)
          remove transaction and related (means if virement) if a virement remove also the related txn
 void removeVirement(Virement v)
          same as removeTransaction but remove also the related
 void setAccountGroup(AccountGroup accountGroup)
          Setter for property accountGroup.
 void setBank(Bank bank)
          Setter for property bank.
 void setCcy(java.util.Currency ccy)
          Setter for property ccy.
 void setComment(java.lang.String comment)
          Setter for property comment.
 void setCreationDate(java.util.Date creationDate)
          Setter for property creationDate.
 void setFlag(int flag, boolean value)
          convenient see FLAG_xxx to get possible flag values
 void setFlags(java.util.BitSet flags)
          Setter for property flags.
 void setIban(java.lang.String iban)
          Setter for property iban.
 void setId(java.lang.String id)
          Setter for property id.
 void setInitialAmount(double initialAmount)
          Setter for property initialAmount.
 void setLastBalancedDate(java.util.Date lastBalancedDate)
          Setter for property lastBalancedDate.
 void setLastModificationDate(java.util.Date lastModificationDate)
          Setter for property lastModificationDate.
 void setMaxAmount(double maxAmount)
          Setter for property maxAmount.
 void setMinAmount(double minAmount)
          Setter for property minAmount.
 void setName(java.lang.String name)
          Setter for property name.
 void setRefs(java.lang.String refs)
          Setter for property refs.
 void setTxns(java.util.List txns)
          Setter for property txns.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 void updateLastModificationDate()
          update to now time
 void updateTotals(java.util.Date date)
          update total variable total = big total dtotal = debit total ctotal = credit total dayTotal = big total until this date
 int updateTransaction(int index)
          to call whenever a transaction change its date and want to keep the list ordered Automatically managed related for Virement
 int updateTransaction(Transaction t)
          to call whenever a transaction change its date and want to keep the list ordered Automatically managed related synch for Virement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serialization trick to be compatible with older implementation ,interoperability

See Also:
Constant Field Values

i18n

private static final transient java.util.ResourceBundle i18n
resource for i18n


FLAG_ENDED

public static final int FLAG_ENDED
compte cloturé (can't add anymore txn)

See Also:
Constant Field Values

FLAG_FAVORITE

public static final int FLAG_FAVORITE
See Also:
Constant Field Values

FLAG_TVA

public static final int FLAG_TVA
See Also:
Constant Field Values

FLAG_O1

public static final int FLAG_O1
See Also:
Constant Field Values

FLAG_O2

public static final int FLAG_O2
See Also:
Constant Field Values

FLAG_O3

public static final int FLAG_O3
See Also:
Constant Field Values

FLAG_O4

public static final int FLAG_O4
See Also:
Constant Field Values

FLAG_O5

public static final int FLAG_O5
See Also:
Constant Field Values

FLAG_O6

public static final int FLAG_O6
See Also:
Constant Field Values

name

private java.lang.String name

bank

private Bank bank

ccy

private java.util.Currency ccy

txns

private java.util.List txns
List of Transactions can't be null ??? Sort per Date in chronological order, cause 1)normal view 2)allow to compute sum on range of date -)when saved/exported on file, the sort is not reneeded -)allow to compute faster the balande for one specific day Collections.sort(txns,Comparator); binarySearch==> easy even with List


initialAmount

private double initialAmount
solde initial du compte


minAmount

private double minAmount

maxAmount

private double maxAmount

iban

private java.lang.String iban
Identification internationale


refs

private java.lang.String refs
Reference bancaire


id

private java.lang.String id
Holds value of property id.


creationDate

private java.util.Date creationDate
Holds value of property creationDate.


lastModificationDate

private java.util.Date lastModificationDate
derniere modification


lastBalancedDate

private java.util.Date lastBalancedDate
dernier rapprochement


flags

private java.util.BitSet flags
Flags ... for future


accountGroup

private AccountGroup accountGroup
Group of account


comment

private java.lang.String comment
comment


total

private transient double total
Final total


ctotal

private transient double ctotal
Final Credit total


dtotal

private transient double dtotal
Final Debit total


dayTotal

private transient double dayTotal
Today total


creditDayTotal

private transient double creditDayTotal
Today credit total


debitDayTotal

private transient double debitDayTotal
Today debit total

Constructor Detail

Account

public Account()

Account

public Account(java.lang.String id,
               java.lang.String name,
               Bank bank,
               java.util.Date start)
Method Detail

updateTotals

public void updateTotals(java.util.Date date)
update total variable total = big total dtotal = debit total ctotal = credit total dayTotal = big total until this date


updateLastModificationDate

public void updateLastModificationDate()
update to now time


getTxns

public java.util.List getTxns()
Getter for property txns.


setTxns

public void setTxns(java.util.List txns)
Setter for property txns. automatically update total, but when change are made to the list, need to call manually udpateTotals


addTransactionAndRelated

public int addTransactionAndRelated(Transaction t)
in right place in the list warning date may be null !! (virement) different of addTransaction because it manages virement


addTransaction

public int addTransaction(Transaction t)
in right place in the list warning date may be null !! (virement) do nothing special for virement (use addVirement or addTransactionAndRelated instead)


addVirement

public int addVirement(Virement v)
in right place in the list warning date may be null !! (virement) special for virement insert also the related ...


removeTransaction

public void removeTransaction(Transaction t)
remove the transaction from the list of this account, (do nothing special on virement)


removeVirement

public void removeVirement(Virement v)
same as removeTransaction but remove also the related


removeTransactionAndRelated

public void removeTransactionAndRelated(int index)
remove transaction and related (means if virement) if a virement remove also the related txn


removeAllTxnWithRelated

public void removeAllTxnWithRelated()
used just before removing the account for example could be called removeAllTxnWithRelated


updateTransaction

public int updateTransaction(int index)
to call whenever a transaction change its date and want to keep the list ordered Automatically managed related for Virement


updateTransaction

public int updateTransaction(Transaction t)
to call whenever a transaction change its date and want to keep the list ordered Automatically managed related synch for Virement


isEqual

public boolean isEqual(java.lang.String key)

getBank

public Bank getBank()
Getter for property bank.


setBank

public void setBank(Bank bank)
Setter for property bank.


getCcy

public java.util.Currency getCcy()
Getter for property ccy.


setCcy

public void setCcy(java.util.Currency ccy)
Setter for property ccy.


getId

public java.lang.String getId()
Getter for property id.


setId

public void setId(java.lang.String id)
Setter for property id.


getName

public java.lang.String getName()
Getter for property name.


setName

public void setName(java.lang.String name)
Setter for property name.


getTotal

public double getTotal()
Getter for property total. warning: need to call updateTotal before ...


getCreationDate

public java.util.Date getCreationDate()
Getter for property creationDate.


setCreationDate

public void setCreationDate(java.util.Date creationDate)
Setter for property creationDate.


getIban

public java.lang.String getIban()
Getter for property iban.


setIban

public void setIban(java.lang.String iban)
Setter for property iban.


getRefs

public java.lang.String getRefs()
Getter for property refs.


setRefs

public void setRefs(java.lang.String refs)
Setter for property refs.


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getInitialAmount

public double getInitialAmount()
Getter for property initialAmount.


setInitialAmount

public void setInitialAmount(double initialAmount)
Setter for property initialAmount.


getCtotal

public double getCtotal()
Getter for property ctotal.


getCreditDayTotal

public double getCreditDayTotal()

getDebitDayTotal

public double getDebitDayTotal()

getDtotal

public double getDtotal()
Getter for property dtotal.


getDayTotal

public double getDayTotal()
Getter for property dtotal.


getMinAmount

public double getMinAmount()
Getter for property minAmount.


setMinAmount

public void setMinAmount(double minAmount)
Setter for property minAmount.


getMaxAmount

public double getMaxAmount()
Getter for property maxAmount.


setMaxAmount

public void setMaxAmount(double maxAmount)
Setter for property maxAmount.


getFlags

public java.util.BitSet getFlags()
Getter for property flags.


isFlagSet

public boolean isFlagSet(int flag)
don't use with flag none


setFlag

public void setFlag(int flag,
                    boolean value)
convenient see FLAG_xxx to get possible flag values


setFlags

public void setFlags(java.util.BitSet flags)
Setter for property flags.


getLastModificationDate

public java.util.Date getLastModificationDate()
Getter for property lastModificationDate.


setLastModificationDate

public void setLastModificationDate(java.util.Date lastModificationDate)
Setter for property lastModificationDate.


getLastBalancedDate

public java.util.Date getLastBalancedDate()
Getter for property lastBalancedDate.


setLastBalancedDate

public void setLastBalancedDate(java.util.Date lastBalancedDate)
Setter for property lastBalancedDate.


getAccountGroup

public AccountGroup getAccountGroup()
Getter for property accountGroup.


setAccountGroup

public void setAccountGroup(AccountGroup accountGroup)
Setter for property accountGroup.


compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.

Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.

It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

Specified by:
compareTo in interface java.lang.Comparable

contains

public boolean contains(Transaction t)

getComment

public java.lang.String getComment()
Getter for property comment.


setComment

public void setComment(java.lang.String comment)
Setter for property comment.