예제 #1
0
 public MyList<ReceiptPO> getAllBySatte(State state) throws RemoteException {
   MyList<ReceiptPO> re = new MyList<ReceiptPO>();
   ArrayList<String> strs = dh.read();
   for (String string : strs) {
     ReceiptPO temp = new ReceiptPO(string);
     if (temp.getState() == state) {
       re.add(temp);
     }
   }
   return re;
 }
예제 #2
0
 public MyList<ReceiptPO> getAll(String w) throws RemoteException {
   MyList<ReceiptPO> re = new MyList<ReceiptPO>();
   ArrayList<String> strs = dh.read();
   for (String string : strs) {
     ReceiptPO po = (new ReceiptPO(string));
     if (po.getWriter().equals(w)) {
       re.add(po);
     }
   }
   return re;
 }
예제 #3
0
  public boolean update(ReceiptPO newone) {

    ArrayList<ReceiptPO> re = this.getAll();
    for (int i = 0; i < re.size(); i++) {
      if (re.get(i).getID().equals(newone.getID())) {
        re.remove(i);
        re.add(newone);
        return this.dh.rewrite(re);
      }
    }

    return false;
  }