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