1 16 package org.apache.commons.collections.bag; 17 18 import java.util.Set ; 19 20 import org.apache.commons.collections.Bag; 21 import org.apache.commons.collections.collection.AbstractCollectionDecorator; 22 23 33 public abstract class AbstractBagDecorator 34 extends AbstractCollectionDecorator implements Bag { 35 36 40 protected AbstractBagDecorator() { 41 super(); 42 } 43 44 50 protected AbstractBagDecorator(Bag bag) { 51 super(bag); 52 } 53 54 59 protected Bag getBag() { 60 return (Bag) getCollection(); 61 } 62 63 public int getCount(Object object) { 65 return getBag().getCount(object); 66 } 67 68 public boolean add(Object object, int count) { 69 return getBag().add(object, count); 70 } 71 72 public boolean remove(Object object, int count) { 73 return getBag().remove(object, count); 74 } 75 76 public Set uniqueSet() { 77 return getBag().uniqueSet(); 78 } 79 80 } 81 | Popular Tags |