1 16 package org.apache.commons.collections.bag; 17 18 import java.util.Comparator ; 19 20 import org.apache.commons.collections.SortedBag; 21 import org.apache.commons.collections.Transformer; 22 23 38 public class TransformedSortedBag 39 extends TransformedBag implements SortedBag { 40 41 42 private static final long serialVersionUID = -251737742649401930L; 43 44 55 public static SortedBag decorate(SortedBag bag, Transformer transformer) { 56 return new TransformedSortedBag(bag, transformer); 57 } 58 59 70 protected TransformedSortedBag(SortedBag bag, Transformer transformer) { 71 super(bag, transformer); 72 } 73 74 79 protected SortedBag getSortedBag() { 80 return (SortedBag) collection; 81 } 82 83 public Object first() { 85 return getSortedBag().first(); 86 } 87 88 public Object last() { 89 return getSortedBag().last(); 90 } 91 92 public Comparator comparator() { 93 return getSortedBag().comparator(); 94 } 95 96 } 97 | Popular Tags |