summaryrefslogtreecommitdiff
path: root/NET/worlds/console/StatRateNode.java
blob: e1a74a146fccc99fecda1503c249353aff95fe82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*    */ package NET.worlds.console;
/*    */ 
/*    */ import NET.worlds.core.Std;
/*    */ import java.awt.List;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class StatRateNode
/*    */   extends StatMan
/*    */   implements MainCallback
/*    */ {
/* 17 */   private static StatRateNode _singleInstance = new StatRateNode();
/*    */   private int _lastTime;
/*    */   
/* 20 */   public static StatRateNode getNode() { return _singleInstance; }
/*    */   
/*    */   private StatRateNode()
/*    */   {
/* 24 */     StatisticsRoot.getNode().addChild(this);
/*    */   }
/*    */   
/*    */   public String toString()
/*    */   {
/* 29 */     return "Active Threads";
/*    */   }
/*    */   
/*    */ 
/*    */   private static final int TITLE = 0;
/*    */   synchronized void grabList(List list)
/*    */   {
/* 36 */     super.grabList(list);
/* 37 */     Main.register(this);
/*    */   }
/*    */   
/*    */ 
/*    */   synchronized void releaseList(boolean terminalCallback)
/*    */   {
/* 43 */     if (!terminalCallback) {
/* 44 */       Main.unregister(this);
/*    */     }
/* 46 */     super.releaseList(terminalCallback);
/*    */   }
/*    */   
/*    */ 
/*    */   public synchronized void mainCallback()
/*    */   {
/* 52 */     int thisTime = Std.getFastTime();
/* 53 */     if (thisTime - this._lastTime > 1000) {
/* 54 */       updateList();
/* 55 */       this._lastTime = thisTime;
/*    */     }
/*    */   }
/*    */   
/*    */ 
/*    */   private static final int BLANK1 = 1;
/*    */   
/*    */   private static final int THREADS = 2;
/*    */   
/*    */   private int lastQueueLength;
/*    */   void createList()
/*    */   {
/* 67 */     this._grabbedList.add("Active Thread Statistics", 0);
/* 68 */     this._grabbedList.add("", 1);
/*    */     
/* 70 */     this.lastQueueLength = Main.queueLength();
/*    */     
/* 72 */     this._grabbedList
/* 73 */       .add("Number main threads: " + this.lastQueueLength, 2);
/*    */   }
/*    */   
/*    */   void updateList()
/*    */   {
/* 78 */     if (Main.queueLength() != this.lastQueueLength) {
/* 79 */       this.lastQueueLength = Main.queueLength();
/* 80 */       this._grabbedList.replaceItem("Number main threads: " + this.lastQueueLength, 
/* 81 */         2);
/*    */     }
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\StatRateNode.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */