@@ -0,0 +1,1611 @@
+/**%0A * This class will be the definer of the object box%0A * @author David Ruiz Carrasco%0A * @version 2.Oct.2014%0A */%0Apublic class Box %7B%0A%0A%09int MAX_SIZE = 12, numBottles;%0A%09private String labelBox, labelStorageUnit;%0A%09private Bottle%5B%5D bottles;%0A%0A%09/**%0A%09 * This method is the constructor of the class%0A%09 * @param lB the label of the box%0A%09 */%0A%09public Box(String lB)%7B%0A%09%09this.labelBox = lB;%0A%09%09this.labelStorageUnit=null;%0A%09%09this.bottles = new Bottle%5BMAX_SIZE%5D;%0A%09%09numBottles = 0;%0A%0A%09%7D%0A%0A%09/**%0A%09 * This method allows to know whether the box is full of bottles or there is, at least, an available space%0A%09 * @return a boolean variable, true if the box is full and false if no%0A%09 */%0A%09public boolean isFull()%7B%0A%09%09return (numBottles %3E= MAX_SIZE);%0A%09%7D%0A%0A%09/**%0A%09 * This method allows to add a bottle to the box, if there is any spare space%0A%09 * @param b the new bottle%0A%09 */%0A%09public void addBottle(Bottle b)%7B%0A%09%09if(!isFull())%7B%0A%09%09%09bottles%5BnumBottles%5D = b; %0A%09%09%09numBottles++;%0A%09%09%7D %0A%09%7D%0A%0A%09/**%0A%09 * This method returns the label of the box which sais to which storage unit it must be delivered%0A%09 * @return the label of the box which sais to which storage unit it must be delivered%0A%09 */%0A%09public String getLabelStorageUnit()%7B%0A%09%09return labelStorageUnit;%0A%09%7D%0A%0A%09/**%0A%09 * This method sets the final storage unit of the box with its label%0A%09 * @param l the label of the box which sais to which storage unit it must be delivered %0A%09 */%0A%09public void setLabel(String l)%7B%0A%09%09this.labelStorageUnit=l;%0A%09%7D%0A%0A%09/**%0A%09 * This method returns the label identifier of the box%0A%09 * @return the identifier label of the box%0A%09 */%0A%09public String getLabelBox()%7B%0A%09%09return labelBox;%0A%09%7D%0A%09%0A%7D%0A

Create Box.java