File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\index\TreeNode.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.index;
8
9 import org.h2.result.Row;
10
11 /**
12 * Represents a index node of a tree index.
13 */
14 class TreeNode {
15
16 /**
17 * The balance. For more information, see the AVL tree documentation.
18 */
19 int balance;
20
21 /**
22 * The left child node or null.
23 */
24 TreeNode left;
25
26 /**
27 * The right child node or null.
28 */
29 TreeNode right;
30
31 /**
32 * The parent node or null if this is the root node.
33 */
34 TreeNode parent;
35
36 /**
37 * The row.
38 */
39 final Row row;
40
41 TreeNode(Row row) {
42 this.row = row;
43 }
44
45 /**
46 * Check if this node is the left child of its parent. This method returns
47 * true if this is the root node.
48 *
49 * @return true if this node is the root or a left child
50 */
51 boolean isFromLeft() {
52 return parent == null || parent.left == this;
53 }
54
55 }
56