Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 package com.browseengine.bobo.geosearch.impl;
 
Requires: a total ordering on tree[] where tree[0] is the root node, tree[1] is the left child of root, tree[2] is right child of root, and so on. The value for a null node should be {{@link NULL_NODE_VALUE}.

Author(s):
Ken McCracken
public class IntBTree extends BTree<Integer> {
    public static final int NULL_NODE_VALUE = -1;
    
    private final int[] tree;
    
    public IntBTree(int[] tree) {
        super(tree.lengthtrue);
        this. = tree;
    }

    
    @Override
    public int getArrayLength() {
        return .;
    }
    
    @Override
    protected boolean isNullNoRangeCheck(int index) {
        int value = [index];
        return value == ;
    }
    
    @Override
    protected Integer getValueAtIndex(int index) {
        return [index];
    }
    
    @Override
    protected int compare(int indexInteger value) {
        int valueAsInt = value;
        return [index] - valueAsInt;
    }
    
    @Override
    protected int compareValuesAt(int leftIndexint rightIndex) {
        return [leftIndex] - [rightIndex];
    }
    @Override
    protected void setValueAtIndex(int indexInteger valuethrows IOException {
        [index] = value;
    }
    @Override
    public void close() throws IOException {
    }
    
    
New to GrepCode? Check out our FAQ X