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