📄 index.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package indexManager;import catalogManager.*;import java.io.Serializable;import java.util.ArrayList;/** * * @author outlaw */public class Index implements Serializable{ BpTree bt=null; Seq seq=null; boolean chooseBP; boolean dirty; String path; String fullName; String tbName; String indName; public Index(String tbName,String path,String indName,String attribName){ this.chooseBP=CatalogManager.useBP; this.path=path+tbName+"_index/"; this.tbName=tbName; this.indName=indName; this.fullName=path+tbName+"_index/"+indName+".ind"; if(chooseBP) { bt=new BpTree(IndexManager.BP_SIZE,attribName,tbName); }else { } this.dirty=true; } public void setIndexName(String name) { this.indName=name; this.fullName=path+indName+".ind"; } public Bucket find(Comparable key) { if(chooseBP) { return bt.find(key); }else { } return null; } public boolean isEmpty() { return bt.isRootNull(); } public void insert(Bucket bucket) { if(chooseBP) { bt.insert(bucket); }else { } } public void delete(Comparable key) { if(chooseBP) { }else { } } public String getAttribName() { if(chooseBP) { return bt.getAttr(); }else { return null; } } public void remove(Comparable key) { if(chooseBP) { bt.remove(key); } else { } } public String getTBName() { return bt.getHolder(); } public boolean isDirty() { return dirty; } public void setDirty() { dirty=true; } public void clearDirty() { dirty=false; } public String getPath() { return path; } public String getFullName() { return fullName; } public ArrayList<Integer> findEqual(Comparable key) { if(chooseBP) { return bt.findE(key); }else { return null; } } public ArrayList<Integer> findSmaller(Comparable key) { if(chooseBP) { return bt.findB(key); }else { return null; } } public ArrayList<Integer> findSmallerOrEqual(Comparable key) { if(chooseBP) { return bt.findBE(key); }else { return null; } } public ArrayList<Integer> findLarger(Comparable key) { if(chooseBP) { return bt.findA(key); }else { return null; } } public ArrayList<Integer> findLargerOrEqual(Comparable key) { if(chooseBP) { return bt.findAE(key); }else { return null; } } public String getIndexName() { return indName; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -