33 List<String> memKeys =
new ArrayList<String>(memoryMap.keySet());
34 Collections.sort(memKeys);
39 Color GRAY_COLOR =
new Color(100,100,100);
42 for (String memKey : memKeys) {
46 List<String> keys =
new ArrayList<String>(memory.
getKeys());
47 Collections.sort(keys);
49 List<Color> highlightColors =
new ArrayList<Color>();
50 List<String> highlightList =
new ArrayList<String>();
51 for (String key : keys) {
52 Object value = memory.
get(key);
54 String varName =
"$" + memKey +
".";
58 if (key.startsWith(
"$")) {
59 varName += key.substring(1);
66 if (varName.length() > 35) {
67 varName = varName.substring(0, 35) +
"...";
70 highlightColors.add(HIGHLIGHT_COLOR);
71 highlightList.add(varName);
74 if (value instanceof Boolean || value instanceof String || value instanceof Float || value instanceof Integer || value instanceof Long) {
75 text +=
" = " + value.toString();
76 }
else if (value !=
null) {
77 text +=
" = " + value.getClass().getSimpleName() +
"@" + value.hashCode();
79 text +=
" = " +
"null";
83 String eText =
"(e=" + (float)((
int)(
expire * 10)/10f) +
")";
87 highlightColors.add(GRAY_COLOR);
88 highlightList.add(eText);
101 System.out.println(text);