KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > collections > BaseTreeMap


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// This file is
5
// Copyright (C) 2002-@year@ by Leo Mekenkamp. All rights reserved.
6
// $Id: BaseTreeMap.java,v 1.9 2003/11/20 23:18:41 per_nyfelt Exp $
7

8 package org.ozoneDB.collections;
9
10 import java.util.Collection JavaDoc;
11 import java.util.Iterator JavaDoc;
12 import java.util.Set JavaDoc;
13
14 /**
15  * <p>You are encouraged NOT to use this interface, but rather just use {@link
16  * OzoneTreeMap}, which does not contain the 'internal' methods, or even
17  * {@link java.util.SortedMap}, which does not have any ozone dependency at all</p>
18  * <p>This interface functions as a sort of base interface for ozone aware treemaps,
19  * were those treemaps themselves can implement if the nodes in the tree are
20  * ozone objects themselves or merely serializables.</p>
21  *
22  * @author <a HREF="mailto:ozoneATmekenkampD0Tcom">Leo Mekenkamp (mind the anti-sp@m)</a> (adaptation for ozone)
23  */

24 public interface BaseTreeMap extends OzoneTreeMap {
25
26     public void _org_ozoneDB_resetEntries(); /*update*/
27
28     public void _org_ozoneDB_fabricateTree(int count); /*update*/
29
30     public int _org_ozoneDB_compare(Object JavaDoc o1, Object JavaDoc o2);
31
32     public Node _org_ozoneDB_firstNode();
33
34     public Node _org_ozoneDB_getNode(Object JavaDoc key);
35
36     public Node _org_ozoneDB_highestLessThan(Object JavaDoc key);
37
38     public Node _org_ozoneDB_lowestGreaterThan(Object JavaDoc key, boolean first);
39
40     public void _org_ozoneDB_putKeysLinear(Iterator JavaDoc keys, int count); /*update*/
41
42     public void _org_ozoneDB_removeNode(Node node); /*update*/
43
44     public Node _org_ozoneDB_successor(Node node);
45
46     public int _org_ozoneDB_getModification();
47
48     public Set JavaDoc _org_ozoneDB_keySet(); /*update*/
49
50     public Set JavaDoc _org_ozoneDB_entrySet(); /*update*/
51
52     public Collection JavaDoc _org_ozoneDB_values(); /*update*/
53
54     public boolean _org_ozoneDB_alwaysUseInternalIterator();
55     
56     /**
57      * Node interface should be here and not in the Impl class; the BaseTreeMap
58      * interface _is_ part of the implementation for an OzoneMap...
59      */

60     public interface Node extends AbstractOzoneMap.Node {
61
62         /**
63          * Color status of a node.
64         */

65         static final int RED = -1;
66         static final int BLACK = 1;
67
68         public void setLeft(Node left);
69
70         public Node getLeft();
71
72         public void setRight(Node right);
73
74         public Node getRight();
75
76         public void setParent(Node parent);
77
78         public Node getParent();
79
80         public void setColor(int color);
81
82         public int getColor();
83
84         public boolean isNil();
85
86     }
87
88 }
Popular Tags