20
|
1 package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle_core;
|
|
2
|
|
3 import jp.ac.u_ryukyu.cr.ie.tatsuki.xmlTestBbs.JuGrix;
|
|
4 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree;
|
|
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode;
|
|
6
|
|
7 import java.util.Random;
|
|
8
|
|
9 /**
|
|
10 * Created by e115731 on 15/03/14.
|
|
11 */
|
|
12 public class ReadTreeThread extends Thread {
|
|
13
|
|
14 JungleTree tree;
|
|
15 private long findCount;
|
|
16
|
|
17 boolean loop = true;
|
|
18
|
|
19 public ReadTreeThread(JungleTree tree) {
|
|
20 this.tree = tree;
|
|
21 this.findCount = 0;
|
|
22 }
|
|
23
|
|
24 public long getFindCount() {
|
|
25 System.out.println("thread count = " + findCount);
|
|
26 return findCount;
|
|
27 }
|
|
28
|
|
29 public void set(boolean loop) {
|
|
30 this.loop = loop;
|
|
31 }
|
|
32
|
|
33 @Override
|
|
34 public void run() {
|
|
35 while (loop) {
|
|
36 TreeNode root = tree.getRootNode();
|
|
37 if (root.getAttributes().getString("test").equals("test"))
|
|
38 findCount++;
|
|
39 else
|
|
40 System.out.println("faild");
|
|
41 // String attribute = root.getAttributes().getString("test");
|
|
42 // if (attribute.equals("test"))
|
|
43 // findCount++;
|
|
44 // else
|
|
45 // System.out.println("faild");
|
|
46 }
|
|
47 }
|
|
48 }
|