All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.demos.a401k.b401kDap

java.lang.Object
   |
   +----com.ibm.beans.demos.a401k.b401kDap

public class b401kDap
extends Object
implements Serializable, AccountIDChangedListener, PercentListener

This class is part of the 401k demo and implements the b401kDap or data access part (DAP) bean. The DAP bean serves as the event sink for the AccountIDInformationChanged event and the PercentChanged event. The AccountIDInformationChanged event is sent by the AccountID bean when the user types in a new account id and hits the submit button on the AccountID bean. The PercentChanged event is sent by the b401kViewer bean when the user changes the percentage of one of the investment choices.

This DAP bean serves as the event source for the b401kInformationChanged event. The event is sent the the b401kViewer bean when the investment choices and percentages need to be updated on the viewer.

See Also:
AccountIDChangedEvent, AccountIDChangedListener, PercentEvent, b401kEvent, PercentListener, b401kListener

Constructor Index

 o b401kDap()
Constructs an instance of the b401kDap bean.

Method Index

 o AccountIDInformationChanged(AccountIDChangedEvent)
Responds to an AccountIDChangedEvent.
 o addb401kListener(b401kListener)
Allows other beans to listen to the b401kInformationChanged events this bean generates.
 o fireB401k(String[], int[])
Notifies all registered listeners that a b401kInformationChanged event has occurred.
 o PercentChanged(PercentEvent)
Responds to a PercentEvent.
 o removeb401kListener(b401kListener)
Allows beans to remove themselves from the listener list for this bean's b401kInformationChanged event.
 o setInvestChoicesPercentage(int, int)
Accessor (set) method for the percentage value of a particular investment choice.

Constructors

 o b401kDap
 public b401kDap()
Constructs an instance of the b401kDap bean. The constructor initializes the investment choices and the percentage of each investment choice that make up the total portfolio.

Methods

 o setInvestChoicesPercentage
 public void setInvestChoicesPercentage(int index,
                                        int value)
Accessor (set) method for the percentage value of a particular investment choice.

Parameters:
index - The index into the investment choices array or list.
value - The new percentage value for that particular investment choice.
 o AccountIDInformationChanged
 public void AccountIDInformationChanged(AccountIDChangedEvent e)
Responds to an AccountIDChangedEvent. This method is invoked when the AccountID bean has been wired to this DAP bean and the user enters an account number and presses the submit button on the AccountID.

Parameters:
e - The event signifying that a new account id has been submitted.
 o PercentChanged
 public void PercentChanged(PercentEvent pE)
Responds to a PercentEvent. This method is invoked when the b401kViewer bean has been wired to this DAP bean and the user changes a percentage of one of the investment choices.

Parameters:
pE - The event signifying that a new percentage has been chosen
 o addb401kListener
 public synchronized void addb401kListener(b401kListener b401kL)
Allows other beans to listen to the b401kInformationChanged events this bean generates. This is the addListener method for all listeners that want to be notified when a b401kInformationChanged event occurs. In the demo, the b401kViewer bean is wired to this DAP bean and is notified when the b401kInformationChanged event happens.

Parameters:
b401kL - The registering listener.
See Also:
removeb401kListener
 o removeb401kListener
 public synchronized void removeb401kListener(b401kListener b401kL)
Allows beans to remove themselves from the listener list for this bean's b401kInformationChanged event. This is the removeListener method for all listeners that want to be notified when a b401kInformationChanged event occurs. In the demo, the b401kViewer bean is wired to this DAP bean and is notified when the b401kInformationChanged event happens.

Parameters:
b401kL - The unregistering listener.
See Also:
addb401kListener
 o fireB401k
 public void fireB401k(String ic[],
                       int icp[])
Notifies all registered listeners that a b401kInformationChanged event has occurred. In the demo, this event fires in response to a users investment portfolio being selected or changed.

Parameters:
ic - The string array of the names of the investment choices that make up the portfolio.
icp - The integer array of the corresponding percentages of the investment choices that make up the portfolio.

All Packages  Class Hierarchy  This Package  Previous  Next  Index