1 16 package org.apache.commons.collections.set; 17 18 import java.util.Comparator ; 19 import java.util.Set ; 20 import java.util.SortedSet ; 21 22 32 public abstract class AbstractSortedSetDecorator extends AbstractSetDecorator implements SortedSet { 33 34 38 protected AbstractSortedSetDecorator() { 39 super(); 40 } 41 42 48 protected AbstractSortedSetDecorator(Set set) { 49 super(set); 50 } 51 52 57 protected SortedSet getSortedSet() { 58 return (SortedSet ) getCollection(); 59 } 60 61 public SortedSet subSet(Object fromElement, Object toElement) { 63 return getSortedSet().subSet(fromElement, toElement); 64 } 65 66 public SortedSet headSet(Object toElement) { 67 return getSortedSet().headSet(toElement); 68 } 69 70 public SortedSet tailSet(Object fromElement) { 71 return getSortedSet().tailSet(fromElement); 72 } 73 74 public Object first() { 75 return getSortedSet().first(); 76 } 77 78 public Object last() { 79 return getSortedSet().last(); 80 } 81 82 public Comparator comparator() { 83 return getSortedSet().comparator(); 84 } 85 86 } 87 | Popular Tags |