⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexmanager.java

📁 一个简单的数据库
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package indexManager;import java.util.*;import database.*;import fileManager.*;/** * * @author outlaw */public class IndexManager {    public static ArrayList<Index> indices=new ArrayList<Index>();    public static final int IndexSize=10;    public static final int BP_SIZE=50;                public IndexManager()    {    }    public static void open()    {    }    public static ArrayList<Index> getIndices()    {        return indices;    }    public static Index getIndex(TableData tb)    {        return null;    }    public static Index readIndexIntoMemory(String fullName) throws Exception    {        Index index=FileManager.readIndexIntoMemory(fullName);        addIndex(index);        return index;    }    public static void addIndex(Index index) throws Exception    {        rearrange(index);    }    public static void rearrange(int index)    {        indices.add(indices.remove(index));    }    public static void rearrange(Index index) throws Exception    {        if(indices.size()>=IndexSize)        {            Index oldIndex=indices.get(0);            if(oldIndex.isDirty())            {                FileManager.writeOutIndex(index);            }            indices.remove(0);        }        indices.add(index);    }    public static void close() throws Exception    {        FileManager.writeOutIndices();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -