Exemplo n.º 1
0
 public boolean equals(TextGrid grid) {
   if (grid.getHeight() != this.getHeight() || grid.getWidth() != this.getWidth()) {
     return false;
   }
   int height = grid.getHeight();
   for (int i = 0; i < height; i++) {
     String row1 = this.getRow(i).toString();
     String row2 = grid.getRow(i).toString();
     if (!row1.equals(row2)) return false;
   }
   return true;
 }
Exemplo n.º 2
0
 public static TextGrid makeSameSizeAs(TextGrid grid) {
   return new TextGrid(grid.getWidth(), grid.getHeight());
 }