001: /*
002: * Copyright 2007 Google Inc.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License. You may obtain a copy of
006: * the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013: * License for the specific language governing permissions and limitations under
014: * the License.
015: */
016: package java.util;
017:
018: /**
019: * Sorted map implementation, guarantees log(n) complexity for containsKey, get,
020: * put, and remove. <a
021: * href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/TreeMap.html">[Sun
022: * docs]</a>
023: *
024: * @param <K> key type.
025: * @param <V> value type.
026: */
027: public class TreeMap<K, V> extends AbstractMap<K, V> implements
028: SortedMap<K, V>, Cloneable {
029:
030: public TreeMap() {
031: this (Comparators.natural());
032: }
033:
034: public TreeMap(Comparator<? super K> c) {
035: // TODO(jat): implement
036: throw new UnsupportedOperationException(
037: "TreeMap not implemented");
038: }
039:
040: public TreeMap(Map<? extends K, ? extends V> m) {
041: this ();
042: putAll(m);
043: }
044:
045: public TreeMap(SortedMap<? extends K, ? extends V> m) {
046: // TODO(jat): optimize
047: this ((Map<? extends K, ? extends V>) m);
048: }
049:
050: @Override
051: public void clear() {
052: // TODO(jat): implement
053: }
054:
055: public Comparator<? super K> comparator() {
056: // TODO(jat): implement
057: return null;
058: }
059:
060: @Override
061: public boolean containsKey(Object key) {
062: // TODO(jat): implement
063: return false;
064: }
065:
066: @Override
067: public Set<Map.Entry<K, V>> entrySet() {
068: // TODO(jat): implement
069: return null;
070: }
071:
072: public K firstKey() {
073: // TODO(jat): implement
074: return null;
075: }
076:
077: @Override
078: public V get(Object key) {
079: // TODO(jat): implement
080: return null;
081: }
082:
083: public SortedMap<K, V> headMap(K toKey) {
084: // TODO(jat): implement
085: return null;
086: }
087:
088: public K lastKey() {
089: // TODO(jat): implement
090: return null;
091: }
092:
093: @Override
094: public V put(K key, V value) {
095: // TODO(jat): implement
096: return null;
097: }
098:
099: @Override
100: public V remove(Object key) {
101: // TODO(jat): implement
102: return null;
103: }
104:
105: @Override
106: public int size() {
107: // TODO(jat): implement
108: return 0;
109: }
110:
111: public SortedMap<K, V> subMap(K fromKey, K toKey) {
112: // TODO(jat): implement
113: return null;
114: }
115:
116: public SortedMap<K, V> tailMap(K fromKey) {
117: // TODO(jat): implement
118: return null;
119: }
120:
121: }
|