*/
public Object put(Object key, Object value)
{
- System.out.println("TreeMap.put() " + (String)root.key);
TreeNode current = root;
TreeNode parent = nil;
int comparison = 0;
root = n;
return null;
}
- if (comparison > 0)
+ if (comparison > 0) {
parent.right = n;
- else
+ } else {
parent.left = n;
+ }
// Rebalance after insert.
insertFixup(n);
- System.out.println("==== " + (String)root.key);
return null;
}
*/
final TreeNode lowestGreaterThan(Object key, boolean first, boolean equal)
{
- System.out.println("TreeMap.lowestGreaterThan(Object, boolean, boolean)() " + (String)key + " " + (String)root.key);
if (key == nil)
return first ? firstNode() : nil;
while (current != nil)
{
- System.out.println("AAAA");
last = current;
comparison = compare(key, current.key);
- System.out.println(comparison);
if (comparison > 0)
current = current.right;
else if (comparison < 0)
throw new /*IllegalArgument*/Exception("IllegalArgumentException: fromKey > toKey");
this.minKey = minKey;
this.maxKey = maxKey;
- System.out.println("TreeSubMap() " + (String)this.minKey + " " + (String)this.maxKey);
}
public int size()
{
- System.out.println("TreeSubMap.size() " + (String)this.minKey + " " + (String)this.maxKey);
TreeNode node = map.lowestGreaterThan(minKey, true);
TreeNode max = map.lowestGreaterThan(maxKey, false);
- System.out.println((String)node.key);
- System.out.println((String)max.key);
int count = 0;
while (node != max)
{