01: package vicazh.hyperpool.stream;
02:
03: import java.util.*;
04:
05: /**
06: * The priority
07: *
08: * @author Victor Zhigunov
09: * @version 0.4.0
10: */
11:
12: public class Priority extends ArrayList<Object> {
13: /**
14: * The default priority that is assigned to a thread.
15: */
16: public final static int NO_LIMIT_PRIORITY = 10;
17:
18: private long clientindexsave;
19:
20: private long serverindexsave;
21:
22: long clientindex;
23:
24: long serverindex;
25:
26: public void action() {
27: clientindexsave = clientindex;
28: serverindexsave = serverindex;
29: clientindex = 0;
30: serverindex = 0;
31: }
32:
33: private int client;
34:
35: public void setClient(int client) {
36: this .client = client;
37: }
38:
39: public int getClient() {
40: return client;
41: }
42:
43: private int server;
44:
45: public void setServer(int server) {
46: this .server = server;
47: }
48:
49: public int getServer() {
50: return server;
51: }
52:
53: long getClientCount() {
54: return clientindexsave + clientindex;
55: }
56:
57: long getServerCount() {
58: return serverindexsave + serverindex;
59: }
60: }
|