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

📄 onlineirrelationindexlist.java

📁 dragontoolkit用于机器学习
💻 JAVA
字号:
package dragon.ir.index;import java.util.ArrayList;/** * <p>The class is used to add or get a given IR relation </p> * <p> </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: IST, Drexel University</p> * @author Davis Zhou * @version 1.0 */public class OnlineIRRelationIndexList implements IRRelationIndexList, IRSignatureIndexList{    private ArrayList indexList;    public OnlineIRRelationIndexList() {        indexList=new ArrayList(5000);    }    public IRSignature getIRSignature(int index){        return get(index);    }    public IRRelation get(int index) {        return index<indexList.size()?(IRRelation)indexList.get(index):null;    }    public boolean add(IRRelation curRelation) {        IRRelation oldRelation;        if (curRelation.getIndex()<indexList.size()) {            oldRelation = (IRRelation) indexList.get(curRelation.getIndex());            oldRelation.addFrequency(curRelation.getFrequency());            oldRelation.setDocFrequency(oldRelation.getDocFrequency() + curRelation.getDocFrequency());        }        else {            for(int i=indexList.size();i<curRelation.getIndex();i++){                indexList.add(new IRRelation(i,0,0,-1,-1));            }            curRelation=curRelation.copy();            indexList.add(curRelation);        }        return true;    }    public int size() {        return indexList.size();    }    public void close() {        indexList.clear();    }}

⌨️ 快捷键说明

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