Advertisement
Guest User

pasted

a guest
Dec 1st, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. public void build(String key,String string) throws IOException, XLException {
  2.         if (string.isEmpty()){
  3.                 cellMap.remove(key);
  4.         }
  5.         else if (string.startsWith("#")){
  6.         cellMap.put(key, new StringCell(string));
  7.         }
  8.         else {
  9.                  ExprParser exprP = new ExprParser();
  10.                  Expr expr = exprP.build(string);
  11.                  ExprCell newCell = new ExprCell(expr);
  12.                  newCell.makeBomb();
  13.                  cellMap.put(key, newCell);
  14.                  try {
  15.                         for (Cell c: cellMap.getMap().values()){
  16.                            
  17.                                 if(c != newCell){
  18. //                                  System.out.println(" c!=newCell");
  19.                                     if(c instanceof ExprCell){
  20.                                         ((ExprCell) c.value()).value();    
  21.                                     }
  22.                                                                  
  23.                                 }
  24.                          }
  25.                  } catch (XLException e) {
  26.                          newCell.defuse();
  27.                          throw e;
  28.                          }
  29.                  newCell.defuse();
  30.                  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement