view src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/ReadJungleThread.java @ 21:c8d8864714d4

add build.gradle
author tatsuki
date Tue, 28 Apr 2015 08:16:08 +0900
parents 195c1a644550
children 69dca2ab1783
line wrap: on
line source

package jp.ac.u_ryukyu.ie.cr.tatsuki.xml;

import java.util.Random;
import jp.ac.u_ryukyu.cr.ie.tatsuki.xmlTestBbs.JuGrix;


public class ReadJungleThread extends Thread {

    JuGrix jugrix;
    int findCount;
    int successCount;
    int faildCount;
    boolean loop = true;

    public ReadJungleThread(JuGrix jugrix) {
        this.jugrix = jugrix;
        this.findCount = 0;
        this.successCount = 0;
        this.faildCount = 0;
    }

    public int getFindCount() {
      System.out.println("thread count = " + findCount);
        return findCount;
    }

    public void set(boolean loop) {
        this.loop = loop;
    }

    @Override
    public void run() {
        while (loop) {
            
            findCount++;
            boolean account = jugrix.isActive("p:" + 100,"v:1");
            if (account)
              successCount++;
            else
              faildCount++;
        }
    }
}