1 19 package bak.pcj.adapter; 20 21 import bak.pcj.set.DoubleSortedSet; 22 23 import java.util.Comparator ; 24 import java.util.AbstractSet ; 25 import java.util.SortedSet ; 26 27 41 public class DoubleSortedSetToSortedSetAdapter extends DoubleSetToSetAdapter implements SortedSet { 42 43 53 public DoubleSortedSetToSortedSetAdapter(DoubleSortedSet set) { 54 super(set); 55 } 56 57 64 public Comparator comparator() 65 { return null; } 66 67 75 public Object first() 76 { return new Double (((DoubleSortedSet)set).first()); } 77 78 97 public SortedSet headSet(Object to) 98 { return new DoubleSortedSetToSortedSetAdapter(((DoubleSortedSet)set).headSet( ((Double )to).doubleValue() )); } 99 100 108 public Object last() 109 { return new Double (((DoubleSortedSet)set).last()); } 110 111 137 public SortedSet subSet(Object from, Object to) { 138 double tfrom = ((Double )from).doubleValue(); 139 double tto = ((Double )to).doubleValue(); 140 return new DoubleSortedSetToSortedSetAdapter(((DoubleSortedSet)set).subSet(tfrom, tto)); 141 } 142 143 163 public SortedSet tailSet(Object from) 164 { return new DoubleSortedSetToSortedSetAdapter(((DoubleSortedSet)set).tailSet( ((Double )from).doubleValue() )); } 165 166 } | Popular Tags |