1 package com.daffodilwoods.daffodildb.server.datasystem.indexsystem; 2 3 import com.daffodilwoods.database.utility.P; 4 import com.daffodilwoods.database.resource.*; 5 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.*; 6 import com.daffodilwoods.daffodildb.server.sql99.utils._Reference; 7 import com.daffodilwoods.daffodildb.server.datasystem.btree.BTreeNode; 8 import com.daffodilwoods.daffodildb.server.datasystem.btree.BTreeElement; 9 10 11 class FileBTreeElement extends BTreeElement { 12 13 14 private Object childNodeKey; 15 16 public FileBTreeElement() { 17 } 18 19 20 FileBTreeElement(Object key,Object value) throws DException { 21 super(key,value); 22 } 23 24 public void setChildNodeKey(Object key){ 25 childNodeKey = key; 26 } 27 28 public Object getChildNodeKey(){ 29 return childNodeKey; 30 } 31 32 public void setChild(BTreeNode node) throws DException{ 33 super.setChild(node); 34 if(childNode != null) 35 setChildNodeKey(node.getNodeKey()); 36 } 37 38 public void updateChild(BTreeNode node) throws DException{ 39 setChild(node); 40 currentNode.updateChild(position,node.getNodeKey()); 41 } 42 43 public void clearChild() { 44 childNode = null; 45 currentNode = null; 46 } 47 48 public BTreeNode getChild() throws DException{ 49 if (childNode == null && childNodeKey != null) { 50 childNode = currentNode.getNodeManager().getNode(null,childNodeKey); 51 childNode.setParentElement(this); 52 } 53 return childNode; 54 } 55 } 56 | Popular Tags |