public Map.Entry<Key,Value> getLast(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node.isBranch() ) { node = node.getChild(tx, node.children.length-1); } if( node.values.length>0 ) { int idx = node.values.length-1; return new KeyValueEntry(node.keys[idx], node.values[idx]); } else { return null; } }
public Map.Entry<Key,Value> getFirst(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node .isBranch() ) { node = node.getChild(tx, 0); } if( node.values.length>0 ) { return new KeyValueEntry(node.keys[0], node.values[0]); } else { return null; } }
public Map.Entry<Key,Value> getLast(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node.isBranch() ) { node = node.getChild(tx, node.children.length-1); } if( node.values.length>0 ) { int idx = node.values.length-1; return new KeyValueEntry(node.keys[idx], node.values[idx]); } else { return null; } }
public Map.Entry<Key,Value> getLast(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node.isBranch() ) { node = node.getChild(tx, node.children.length-1); } if( node.values.length>0 ) { int idx = node.values.length-1; return new KeyValueEntry(node.keys[idx], node.values[idx]); } else { return null; } }
public Map.Entry<Key,Value> getFirst(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node .isBranch() ) { node = node.getChild(tx, 0); } if( node.values.length>0 ) { return new KeyValueEntry(node.keys[0], node.values[0]); } else { return null; } }
public Map.Entry<Key,Value> getFirst(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node .isBranch() ) { node = node.getChild(tx, 0); } if( node.values.length>0 ) { return new KeyValueEntry(node.keys[0], node.values[0]); } else { return null; } }
public Map.Entry<Key,Value> getLast(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node.isBranch() ) { node = node.getChild(tx, node.children.length-1); } if( node.values.length>0 ) { int idx = node.values.length-1; return new KeyValueEntry(node.keys[idx], node.values[idx]); } else { return null; } }
public Map.Entry<Key,Value> getFirst(Transaction tx) throws IOException { BTreeNode<Key, Value> node = this; while( node .isBranch() ) { node = node.getChild(tx, 0); } if( node.values.length>0 ) { return new KeyValueEntry(node.keys[0], node.values[0]); } else { return null; } }