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

📄 getsource.java

📁 用java实现的数据挖掘的关联规则的Apriori
💻 JAVA
字号:
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 2007-5-16 21:12:14
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   GetSource.java

package apriori;

import java.io.*;

// Referenced classes of package apriori:
//            FastVector, Item

public class GetSource
{

    public GetSource(String s)
        throws FileNotFoundException
    {
        file = new FileInputStream(s);
        fName = s;
    }

    public void Reset()
        throws IOException, FileNotFoundException
    {
        file.close();
        file = new FileInputStream(fName);
    }

    public int NumOfSets()
        throws IOException, FileNotFoundException
    {
        int i = 0;
        int j = 0;
        Reset();
        do
        {
            if(j == 37)
                break;
            j = file.read();
            if(j == 13)
                i++;
        } while(true);
        Reset();
        return i;
    }

    public FastVector ReadSet()
        throws IOException, FileNotFoundException
    {
        int i = -2;
        FastVector fastvector = new FastVector();
        byte abyte0[] = new byte[30];
        boolean flag = false;
        int j = 0;
        for(; i != 13; i = file.read())
        {
            if(i != 44)
                continue;
            j++;
            i = file.read();
            if(i == 116)
                fastvector.addElement(new Item(j + 65));
            if(i == 102)
                fastvector.addElement(new Item(j + 97));
        }

        return fastvector;
    }

    public FastVector GetSet(int i)
        throws IOException
    {
        int j = 0;
        int k = 0;
        FastVector fastvector = new FastVector();
        Reset();
        do
        {
            if(j == i)
                break;
            k = file.read();
            if(k == 13)
                j++;
        } while(true);
        for(; k != 10; k = file.read());
        fastvector = ReadSet();
        return fastvector;
    }

    public FastVector GetAll()
        throws IOException
    {
        int i = NumOfSets();
        boolean flag = false;
        FastVector fastvector = new FastVector();
        for(int j = 0; j < i; j++)
            fastvector.addElement(GetSet(j));

        return fastvector;
    }

    static byte t[] = {
        116, 114, 117, 101
    };
    static byte f[] = {
        102, 97, 108, 115, 101
    };
    FileInputStream file;
    FastVector vector;
    String fName;
    Item item;

}

⌨️ 快捷键说明

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