comparison src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/test/readTreeAttributeThread.java @ 0:44465893e8b8

first Commit
author Kazuma
date Wed, 30 Nov 2016 01:47:55 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:44465893e8b8
1 package jp.ac.u_ryukyu.ie.cr.jungle.test;
2
3 import jp.ac.u_ryukyu.ie.cr.jungle.JungleTree;
4 import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode;
5
6 /**
7 * Created by e115731 on 15/03/17.
8 */
9 public class readTreeAttributeThread extends DataBaseBenchMarkThread {
10
11 JungleTree tree;
12 private long findCount;
13
14 boolean loop = true;
15
16 public readTreeAttributeThread(JungleTree tree) {
17 this.tree = tree;
18 this.findCount = 0;
19 }
20
21 @Override
22 public long getFindCount() {
23 System.out.println("thread couny = " + findCount);
24 return findCount;
25 }
26
27 public void set(boolean loop) {
28 this.loop = loop;
29 }
30
31 @Override
32 public void run() {
33 while (loop) {
34 TreeNode root = tree.getRootNode();
35 if (root != null) {
36 String attribute = root.getAttributes().getString("key");
37 if (attribute.equals("0"))
38 findCount++;
39 else
40 System.out.println("faild");
41 }
42 }
43 }
44 }