예제 #1
0
  public Object clone() throws CloneNotSupportedException {
    BeerConsumer consumer = (BeerConsumer) super.clone();
    consumer.setAlpineBeersToConsume(new Vector());
    Iterator<Alpine> alpineIterator = this.getAlpineBeersToConsume().iterator();
    while (alpineIterator.hasNext()) {
      Alpine alpine = alpineIterator.next();
      consumer.addAlpineBeerToConsume(alpine.clone());
    }

    consumer.setBlueLightBeersToConsume(new Vector());
    Iterator<BlueLight> blueLightIterator = this.getBlueLightBeersToConsume().iterator();
    while (blueLightIterator.hasNext()) {
      Blue blue = blueLightIterator.next();
      consumer.addBlueLightBeerToConsume((BlueLight) blue.clone());
    }
    return consumer;
  }
예제 #2
0
 public void addAlpineBeerToConsume(Alpine alpine, int index) {
   alpine.setBeerConsumer(this);
   ((Vector) alpineBeersToConsume).insertElementAt(alpine, index);
 }
예제 #3
0
 public void addAlpineBeerToConsume(Alpine alpine) {
   alpine.setBeerConsumer(this);
   ((Vector) alpineBeersToConsume).add(alpine);
 }
예제 #4
0
 public Alpine removeAlpineBeerToConsume(int index) {
   Alpine alpine = ((Vector<Alpine>) alpineBeersToConsume).elementAt(index);
   alpine.setBeerConsumer(null);
   ((Vector) alpineBeersToConsume).removeElementAt(index);
   return alpine;
 }