1 8 package org.ozoneDB.collections; 9 10 import java.util.Collection ; 11 import java.util.Comparator ; 12 import java.util.SortedMap ; 13 import java.util.SortedSet ; 14 15 21 public class FullTreeSetImpl extends BaseTreeSetImpl implements FullTreeSet { 22 23 private static final long serialVersionUID = 1L; 24 25 32 public FullTreeSetImpl() { 33 } 34 35 42 public FullTreeSetImpl(Comparator comparator) { 43 super(comparator); 44 } 45 46 58 public FullTreeSetImpl(Collection collection) { 59 super(collection); 60 } 61 62 71 public FullTreeSetImpl(SortedSet sortedSet) { 72 super(sortedSet); 73 } 74 75 83 public FullTreeSetImpl(SortedMap backingMap, DoNotUse_SeeJavadoc x) { 84 super(0); 85 map = backingMap; 86 } 87 88 93 public Object clone() { 94 95 BaseTreeSet copy = null; 96 try { 97 copy = (BaseTreeSet) database().createObject(FullTreeSetImpl.class, new Class [] {FullTreeSetImpl.class}, new Object [] {self()}); 100 } 101 catch (Exception e) { 102 throw new RuntimeException (e); 103 } 104 return copy; 105 } 106 107 122 public SortedSet headSet(Object to) { 123 SortedMap headMap = map.headMap(to); 126 SortedSet result = (FullTreeSet) database().createObject(FullTreeSetImpl.class, 127 new Class [] {SortedMap .class, DoNotUse_SeeJavadoc.class}, 128 new Object [] {headMap, null}); 129 return result; 130 } 131 132 150 public SortedSet subSet(Object from, Object to) { 151 SortedMap subMap = map.subMap(from, to); 154 return (FullTreeSet) database().createObject( 155 FullTreeSetImpl.class, 156 new Class [] {SortedMap .class, DoNotUse_SeeJavadoc.class}, 157 new Object [] {subMap, null}); 158 } 159 160 175 public SortedSet tailSet(Object from) { 176 SortedMap tailMap = map.tailMap(from); 179 return (FullTreeSet) database().createObject( 180 FullTreeSetImpl.class, 181 new Class [] {SortedMap .class, DoNotUse_SeeJavadoc.class}, 182 new Object [] {tailMap, null} 183 ); 184 } 185 186 protected SortedMap newBackingMap() { 187 return (FullTreeMap) database().createObject(FullTreeMapImpl.class.getName()); 190 } 191 192 protected SortedMap newBackingMap(Comparator comparator) { 193 return (FullTreeMap) database().createObject(FullTreeMapImpl.class.getName(), 196 Comparator .class.getName(), new Object [] {comparator}); 197 } 198 199 } | Popular Tags |