public SortedSet headSet(Object toElement) { return headSet(toElement, false); }
public SortedSet subSet(Object fromElement, Object toElement) { return subSet(fromElement, true, toElement, false); }
public SortedSet tailSet(Object fromElement) { return tailSet(fromElement, true); }
public boolean addAll(Collection c) { if (map.size() == 0 && c.size() > 0 && c instanceof SortedSet && map instanceof TreeMap && eq(((SortedSet)c).comparator(), this.comparator())) { ((TreeMap)map).buildFromSorted(new MapIterator(c.iterator()), c.size()); return true; } else { return super.addAll(c); } }
public NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive) { return new TreeSet(map.subMap(fromElement, fromInclusive, toElement, toInclusive)); }
public TreeSet(Collection c) { map = new TreeMap(); addAll(c); }
public boolean addAll(Collection c) { if (map.size() == 0 && c.size() > 0 && c instanceof SortedSet && map instanceof TreeMap && eq(((SortedSet)c).comparator(), this.comparator())) { ((TreeMap)map).buildFromSorted(new MapIterator(c.iterator()), c.size()); return true; } else { return super.addAll(c); } }
public NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive) { return new TreeSet(map.subMap(fromElement, fromInclusive, toElement, toInclusive)); }
public TreeSet(Collection c) { map = new TreeMap(); addAll(c); }
public boolean addAll(Collection c) { if (map.size() == 0 && c.size() > 0 && c instanceof SortedSet && map instanceof TreeMap && eq(((SortedSet)c).comparator(), this.comparator())) { ((TreeMap)map).buildFromSorted(new MapIterator(c.iterator()), c.size()); return true; } else { return super.addAll(c); } }
public NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive) { return new TreeSet(map.subMap(fromElement, fromInclusive, toElement, toInclusive)); }
public TreeSet(SortedSet s) { map = new TreeMap(s.comparator()); addAll(s); }
public SortedSet subSet(Object fromElement, Object toElement) { return subSet(fromElement, true, toElement, false); }
public SortedSet headSet(Object toElement) { return headSet(toElement, false); }
public SortedSet tailSet(Object fromElement) { return tailSet(fromElement, true); }
public NavigableSet headSet(Object toElement, boolean toInclusive) { return new TreeSet(map.headMap(toElement, toInclusive)); }
public TreeSet(SortedSet s) { map = new TreeMap(s.comparator()); addAll(s); }
public SortedSet subSet(Object fromElement, Object toElement) { return subSet(fromElement, true, toElement, false); }
public SortedSet headSet(Object toElement) { return headSet(toElement, false); }
public SortedSet tailSet(Object fromElement) { return tailSet(fromElement, true); }