001package edu.pdx.cs410J.net;
002
003/**
004 * A <code>BackAccount</code> maintains a integer balance.  It takes
005 * time to access accounts.
006 */
007public class BankAccount {
008  private int balance;
009
010  public int getBalance() {
011    try {
012      long time = (long) (Math.random() * 1000);
013      Thread.sleep(time);
014    } catch (InterruptedException ex) {
015      
016    }
017    return this.balance;
018  }
019
020  public void setBalance(int balance) {
021    try {
022      long time = (long) (Math.random() * 1000);
023      Thread.sleep(time);
024    } catch (InterruptedException ex) { 
025
026    }
027    this.balance = balance;
028  } 
029}