sunclf

Untitled

Dec 7th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     public static void findParentBags (BagRule bag) {
  2.         //List<BagRule> parentBagList = new ArrayList<BagRule>();
  3.  
  4.         if (BagRule.bagsThatCanHoldBag(bag.getColor(), bag.getAttribute(), bagRuleList).isEmpty()) {
  5.             //System.out.println("FOUND");
  6.             parentBagList.add(bag);
  7.         }
  8.  
  9.         else {
  10.             for (BagRule bagIterator : BagRule.bagsThatCanHoldBag(bag.getColor(), bag.getAttribute(), bagRuleList)) {
  11.                 //System.out.println("FOUND");
  12.                 parentBagList.add(bagIterator);
  13.                 findParentBags(bagIterator);
  14.             }
  15.         }
  16.  
  17.     //return parentBagList;
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment