1 19 package bak.pcj.adapter; 20 21 import bak.pcj.ShortIterator; 22 import bak.pcj.set.ShortSortedSet; 23 import bak.pcj.set.AbstractShortSet; 24 import bak.pcj.adapter.IteratorToShortIteratorAdapter; 25 26 import java.util.SortedSet ; 27 28 63 public class SortedSetToShortSortedSetAdapter extends SetToShortSetAdapter implements ShortSortedSet { 64 65 79 public SortedSetToShortSortedSetAdapter(SortedSet set) { 80 super(set); 81 } 82 83 107 public SortedSetToShortSortedSetAdapter(SortedSet set, boolean validate) { 108 super(set, validate); 109 } 110 111 public short first() 112 { return ((Short )(((SortedSet)set).first())).shortValue(); } 113 114 public ShortSortedSet headSet(short to) 115 { return new SortedSetToShortSortedSetAdapter(((SortedSet)set).headSet(new Short (to))); } 116 117 public short last() 118 { return ((Short )(((SortedSet)set).last())).shortValue(); } 119 120 public ShortSortedSet subSet(short from, short to) 121 { return new SortedSetToShortSortedSetAdapter(((SortedSet)set).subSet(new Short (from), new Short (to))); } 122 123 public ShortSortedSet tailSet(short from) 124 { return new SortedSetToShortSortedSetAdapter(((SortedSet)set).tailSet(new Short (from))); } 125 126 } | Popular Tags |