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