java.util
Class TreeMap
java.lang.Object
java.util.AbstractMap
java.util.TreeMap
- All Implemented Interfaces:
- Cloneable, Map, Serializable, SortedMap
- public class TreeMap
- extends AbstractMap
- implements SortedMap, Cloneable, Serializable
|
Method Summary |
(package private) void |
addAllForTreeSet(SortedSet,
Object)
|
private static TreeMap.Entry |
buildFromSorted(int,
int,
int,
int,
Iterator,
ObjectInputStream,
Object)
|
private void |
buildFromSorted(int,
Iterator,
ObjectInputStream,
Object)
|
void |
clear()
|
Object |
clone()
|
private static boolean |
colorOf(TreeMap.Entry)
|
Comparator |
comparator()
|
private int |
compare(Object,
Object)
|
private static int |
computeRedLevel(int)
|
boolean |
containsKey(Object)
|
boolean |
containsValue(Object)
|
private void |
decrementSize()
|
private void |
deleteEntry(TreeMap.Entry)
|
Set |
entrySet()
|
private TreeMap.Entry |
firstEntry()
|
Object |
firstKey()
|
private void |
fixAfterDeletion(TreeMap.Entry)
|
private void |
fixAfterInsertion(TreeMap.Entry)
|
Object |
get(Object)
|
private TreeMap.Entry |
getCeilEntry(Object)
|
private TreeMap.Entry |
getEntry(Object)
|
private TreeMap.Entry |
getPrecedingEntry(Object)
|
SortedMap |
headMap(Object)
|
private void |
incrementSize()
|
private static Object |
key(TreeMap.Entry)
|
Set |
keySet()
|
private TreeMap.Entry |
lastEntry()
|
Object |
lastKey()
|
private static TreeMap.Entry |
leftOf(TreeMap.Entry)
|
private static TreeMap.Entry |
parentOf(TreeMap.Entry)
|
Object |
put(Object,
Object)
|
void |
putAll(Map)
|
private void |
readObject(ObjectInputStream)
|
(package private) void |
readTreeSet(int,
ObjectInputStream,
Object)
|
Object |
remove(Object)
|
private static TreeMap.Entry |
rightOf(TreeMap.Entry)
|
private void |
rotateLeft(TreeMap.Entry)
|
private void |
rotateRight(TreeMap.Entry)
|
private static void |
setColor(TreeMap.Entry,
boolean)
|
int |
size()
|
SortedMap |
subMap(Object,
Object)
|
private TreeMap.Entry |
successor(TreeMap.Entry)
|
SortedMap |
tailMap(Object)
|
private static boolean |
valEquals(Object,
Object)
|
Collection |
values()
|
private boolean |
valueSearchNonNull(TreeMap.Entry,
Object)
|
private boolean |
valueSearchNull(TreeMap.Entry)
|
private void |
writeObject(ObjectOutputStream)
|
root
private transient TreeMap.Entry root
comparator
private Comparator comparator
entrySet
private transient volatile Set entrySet
size
private transient int size
RED
private static final boolean RED
serialVersionUID
private static final long serialVersionUID
BLACK
private static final boolean BLACK
modCount
private transient int modCount
TreeMap
public TreeMap()
TreeMap
public TreeMap(Comparator)
TreeMap
public TreeMap(Map)
TreeMap
public TreeMap(SortedMap)
size
public int size()
- Specified by:
size in interface Map- Overrides:
size in class AbstractMap
clear
public void clear()
- Specified by:
clear in interface Map- Overrides:
clear in class AbstractMap
decrementSize
private void decrementSize()
incrementSize
private void incrementSize()
computeRedLevel
private static int computeRedLevel(int)
readObject
private void readObject(ObjectInputStream)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
writeObject
private void writeObject(ObjectOutputStream)
throws IOException
- Throws:
IOException
clone
public Object clone()
- Overrides:
clone in class AbstractMap
firstKey
public Object firstKey()
- Specified by:
firstKey in interface SortedMap
lastKey
public Object lastKey()
- Specified by:
lastKey in interface SortedMap
containsKey
public boolean containsKey(Object)
- Specified by:
containsKey in interface Map- Overrides:
containsKey in class AbstractMap
containsValue
public boolean containsValue(Object)
- Specified by:
containsValue in interface Map- Overrides:
containsValue in class AbstractMap
values
public Collection values()
- Specified by:
values in interface Map- Overrides:
values in class AbstractMap
comparator
public Comparator comparator()
- Specified by:
comparator in interface SortedMap
putAll
public void putAll(Map)
- Specified by:
putAll in interface Map- Overrides:
putAll in class AbstractMap
entrySet
public Set entrySet()
- Specified by:
entrySet in interface Map
keySet
public Set keySet()
- Specified by:
keySet in interface Map- Overrides:
keySet in class AbstractMap
firstEntry
private TreeMap.Entry firstEntry()
lastEntry
private TreeMap.Entry lastEntry()
deleteEntry
private void deleteEntry(TreeMap.Entry)
fixAfterDeletion
private void fixAfterDeletion(TreeMap.Entry)
fixAfterInsertion
private void fixAfterInsertion(TreeMap.Entry)
rotateLeft
private void rotateLeft(TreeMap.Entry)
rotateRight
private void rotateRight(TreeMap.Entry)
colorOf
private static boolean colorOf(TreeMap.Entry)
valueSearchNull
private boolean valueSearchNull(TreeMap.Entry)
setColor
private static void setColor(TreeMap.Entry,
boolean)
readTreeSet
void readTreeSet(int,
ObjectInputStream,
Object)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
get
public Object get(Object)
- Specified by:
get in interface Map- Overrides:
get in class AbstractMap
remove
public Object remove(Object)
- Specified by:
remove in interface Map- Overrides:
remove in class AbstractMap
compare
private int compare(Object,
Object)
valEquals
private static boolean valEquals(Object,
Object)
addAllForTreeSet
void addAllForTreeSet(SortedSet,
Object)
key
private static Object key(TreeMap.Entry)
valueSearchNonNull
private boolean valueSearchNonNull(TreeMap.Entry,
Object)
headMap
public SortedMap headMap(Object)
- Specified by:
headMap in interface SortedMap
tailMap
public SortedMap tailMap(Object)
- Specified by:
tailMap in interface SortedMap
getCeilEntry
private TreeMap.Entry getCeilEntry(Object)
getEntry
private TreeMap.Entry getEntry(Object)
getPrecedingEntry
private TreeMap.Entry getPrecedingEntry(Object)
leftOf
private static TreeMap.Entry leftOf(TreeMap.Entry)
parentOf
private static TreeMap.Entry parentOf(TreeMap.Entry)
rightOf
private static TreeMap.Entry rightOf(TreeMap.Entry)
successor
private TreeMap.Entry successor(TreeMap.Entry)
buildFromSorted
private void buildFromSorted(int,
Iterator,
ObjectInputStream,
Object)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
put
public Object put(Object,
Object)
- Specified by:
put in interface Map- Overrides:
put in class AbstractMap
subMap
public SortedMap subMap(Object,
Object)
- Specified by:
subMap in interface SortedMap
buildFromSorted
private static TreeMap.Entry buildFromSorted(int,
int,
int,
int,
Iterator,
ObjectInputStream,
Object)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.