1 16 package org.apache.commons.collections.bag; 17 18 import java.util.Comparator ; 19 20 import org.apache.commons.collections.SortedBag; 21 22 32 public abstract class AbstractSortedBagDecorator 33 extends AbstractBagDecorator implements SortedBag { 34 35 39 protected AbstractSortedBagDecorator() { 40 super(); 41 } 42 43 49 protected AbstractSortedBagDecorator(SortedBag bag) { 50 super(bag); 51 } 52 53 58 protected SortedBag getSortedBag() { 59 return (SortedBag) getCollection(); 60 } 61 62 public Object first() { 64 return getSortedBag().first(); 65 } 66 67 public Object last() { 68 return getSortedBag().last(); 69 } 70 71 public Comparator comparator() { 72 return getSortedBag().comparator(); 73 } 74 75 } 76 | Popular Tags |