DocClassSet.java :  » Natural-Language-Processing » Dragon-Toolkit » dragon » ir » classification » Java Open Source

Java Open Source » Natural Language Processing » Dragon Toolkit 
Dragon Toolkit » dragon » ir » classification » DocClassSet.java
package dragon.ir.classification;

import dragon.ir.index.*;
/**
 * <p>The basic data structure for a set of classes for documents</p>
 * <p> </p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: IST, Drexel University</p>
 * @author Davis Zhou
 * @version 1.0
 */

public class DocClassSet {
    private int classNum;
    private DocClass[] arrClass;

    public DocClassSet(int classNum) {
        int i;

        this.classNum =classNum;
        arrClass=new DocClass[classNum];
        for(i=0;i<classNum;i++)
            arrClass[i]=new DocClass(i);
    }

    public DocClass getDocClass(int classID){
        return arrClass[classID];
    }

    public int getClassNum(){
        return classNum;
    }

    public boolean addDoc(int classID, IRDoc curDoc){
        if(classID>=classNum || classID<0)
            return false;
        return arrClass[classID].addDoc(curDoc);
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.