39 * It will be verified that numerical values have defined types and are reasonable, 40 * for example percentage should fit within 0-100 interval. 41 */ 42 public class JstatGCUtilParser { 43 44 public enum GcStatisticsType { 45 INTEGER, DOUBLE, PERCENTAGE, PERCENTAGE_OR_DASH; 46 } 47 48 public enum GcStatistics { 49 S0(GcStatisticsType.PERCENTAGE), 50 S1(GcStatisticsType.PERCENTAGE), 51 E(GcStatisticsType.PERCENTAGE), 52 O(GcStatisticsType.PERCENTAGE), 53 M(GcStatisticsType.PERCENTAGE), 54 CCS(GcStatisticsType.PERCENTAGE_OR_DASH), 55 YGC(GcStatisticsType.INTEGER), 56 YGCT(GcStatisticsType.DOUBLE), 57 FGC(GcStatisticsType.INTEGER), 58 FGCT(GcStatisticsType.DOUBLE), 59 GCT(GcStatisticsType.DOUBLE); 60 61 private final GcStatisticsType type; 62 63 private GcStatistics(GcStatisticsType type) { 64 this.type = type; 65 } 66 67 private GcStatisticsType getType() { 68 return type; 69 } 70 71 public static boolean isHeadline(String... valueArray) { 72 if (valueArray.length != values().length) { 73 return false; 74 } 75 int headersCount = 0; 76 for (int i = 0; i < values().length; i++) { 77 if (valueArray[i].equals(values()[i].toString())) { 78 headersCount++; | 39 * It will be verified that numerical values have defined types and are reasonable, 40 * for example percentage should fit within 0-100 interval. 41 */ 42 public class JstatGCUtilParser { 43 44 public enum GcStatisticsType { 45 INTEGER, DOUBLE, PERCENTAGE, PERCENTAGE_OR_DASH; 46 } 47 48 public enum GcStatistics { 49 S0(GcStatisticsType.PERCENTAGE), 50 S1(GcStatisticsType.PERCENTAGE), 51 E(GcStatisticsType.PERCENTAGE), 52 O(GcStatisticsType.PERCENTAGE), 53 M(GcStatisticsType.PERCENTAGE), 54 CCS(GcStatisticsType.PERCENTAGE_OR_DASH), 55 YGC(GcStatisticsType.INTEGER), 56 YGCT(GcStatisticsType.DOUBLE), 57 FGC(GcStatisticsType.INTEGER), 58 FGCT(GcStatisticsType.DOUBLE), 59 CGC(GcStatisticsType.INTEGER), 60 CGCT(GcStatisticsType.DOUBLE), 61 GCT(GcStatisticsType.DOUBLE); 62 63 private final GcStatisticsType type; 64 65 private GcStatistics(GcStatisticsType type) { 66 this.type = type; 67 } 68 69 private GcStatisticsType getType() { 70 return type; 71 } 72 73 public static boolean isHeadline(String... valueArray) { 74 if (valueArray.length != values().length) { 75 return false; 76 } 77 int headersCount = 0; 78 for (int i = 0; i < values().length; i++) { 79 if (valueArray[i].equals(values()[i].toString())) { 80 headersCount++; |