Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public abstract class BauholzCollection {
  4.     private Set<Collection<? extends Bauholz>> woodPiles = new HashSet<>();
  5.    
  6.     protected void addWoodPileForPrintList(Collection<? extends Bauholz> pile){
  7.         woodPiles.add(pile);
  8.        
  9.     }
  10.    
  11.     public void list(){
  12.        
  13.        
  14.         for (Collection<? extends Bauholz > pile: woodPiles){
  15.            
  16.             for (Bauholz piece: pile){
  17.                 System.out.println("Length: " + piece.getLength());
  18.             }      
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement