1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.sw4j.sample.memory.heap;
18
19
20
21
22
23
24
25
26
27 public class PossibleConfiguration {
28
29 private final boolean hasValues;
30
31 private final int blockSize;
32
33 private final int create;
34
35 private final int shortLifetime;
36
37 private final int mediumLifetime;
38
39 private final int longLifetime;
40
41 private final double longProbability;
42
43 private final double mediumProbability;
44
45 private final String message;
46
47 public PossibleConfiguration(int blockSize, int create, int shortLifetime, int mediumLifetime, int longLifetime,
48 double mediumProbability, double longProbability) {
49 this.hasValues = true;
50 this.blockSize = blockSize;
51 this.create = create;
52 this.shortLifetime = shortLifetime;
53 this.mediumLifetime = mediumLifetime;
54 this.longLifetime = longLifetime;
55 this.mediumProbability = mediumProbability;
56 this.longProbability = longProbability;
57 this.message = "";
58 }
59
60 public PossibleConfiguration(String message) {
61 this.hasValues = false;
62 this.blockSize = 0;
63 this.create = 0;
64 this.shortLifetime = 0;
65 this.mediumLifetime = 0;
66 this.longLifetime = 0;
67 this.mediumProbability = 0.0;
68 this.longProbability = 0.0;
69 this.message = message;
70 }
71
72 public boolean hasValues() {
73 return hasValues;
74 }
75
76 public int getBlockSize() {
77 return blockSize;
78 }
79
80 public int getCreate() {
81 return create;
82 }
83
84 public int getShortLifetime() {
85 return shortLifetime;
86 }
87
88 public int getMediumLifetime() {
89 return mediumLifetime;
90 }
91
92 public int getLongLifetime() {
93 return longLifetime;
94 }
95
96 public double getMediumProbability() {
97 return mediumProbability;
98 }
99
100 public double getLongProbability() {
101 return longProbability;
102 }
103
104 public String getMessage() {
105 return message;
106 }
107
108 }