Example #1
1
 public boolean deleteLastShelf() {
   if (list.size() <= 0) {
     return false;
   }
   StoreLocation last = list.get(list.size() - 1);
   int row = last.getRow();
   int shelf = last.getShelf();
   list.removeIf(
       cell -> {
         return cell.getRow() == row && cell.getShelf() == shelf;
       });
   return true;
 }
Example #2
0
 public ArrayList<String> getShelfLabel() {
   ArrayList<String> result = new ArrayList<String>();
   for (StoreLocation tmp : list) {
     if (result.indexOf(tmp.getRow() + "-" + tmp.getShelf()) == -1)
       result.add(tmp.getRow() + "-" + tmp.getShelf());
   }
   return result;
 }
Example #3
0
 public StoreLocation getByPosition(int rowID, int shelf, int position) {
   for (StoreLocation tmp : list) {
     if (tmp.getRow() == rowID && tmp.getShelf() == shelf && tmp.getPosition() == position)
       return tmp;
   }
   return null;
 }
Example #4
0
 public ArrayList<StoreLocation> getByShelf(int rowID, int shelf) {
   ArrayList<StoreLocation> result = new ArrayList<StoreLocation>();
   for (StoreLocation tmp : list) {
     if (tmp.getRow() == rowID && tmp.getShelf() == shelf) result.add(tmp);
   }
   return result;
 }
Example #5
0
 public int getShelfNumber() {
   if (list.size() == 0) {
     return 0;
   }
   StoreLocation last = list.get(list.size() - 1);
   int lastShelf = last.getShelf();
   return lastShelf;
 }
Example #6
0
 public boolean addShelf() {
   StoreLocation last = list.get(list.size() - 1);
   int shelf = last.getShelf();
   int row = last.getRow();
   if (shelf == 50) {
     row++;
     shelf = 1;
   } else {
     shelf++;
   }
   for (int i = 0; i < shelfForEachRow; i++) {
     this.list.add(new StoreLocation(areaType, row, shelf, i + 1));
   }
   return true;
 }