Class KontoB

java.lang.Object
  extended by KontoB
All Implemented Interfaces:
Konto

public class KontoB
extends java.lang.Object
implements Konto

Konto version B. Uses synchronized methods to display, add and remove money from the account, account cannot become negative.

Author:
Heinz Kredel.

Field Summary
private  double stand
           
 
Constructor Summary
KontoB()
           
KontoB(double a)
           
 
Method Summary
 double getGeld(double b)
          New account balance gets calculated and returned.
 double putGeld(double b)
          Transfers amount to this account.
 double zeigeGeld()
          Displays account balance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stand

private double stand
Constructor Detail

KontoB

public KontoB()

KontoB

public KontoB(double a)
Method Detail

zeigeGeld

public double zeigeGeld()
Displays account balance.

Specified by:
zeigeGeld in interface Konto
Returns:
stand.

putGeld

public double putGeld(double b)
Transfers amount to this account. Blocks if account would become negative.

Specified by:
putGeld in interface Konto
Parameters:
b - amount to put on account.
Returns:
s returns actual balance from account.

getGeld

public double getGeld(double b)
New account balance gets calculated and returned. Blocks if account would become negative.

Specified by:
getGeld in interface Konto
Parameters:
b - amount to remove from desired account.
Returns:
s current account balance.