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