01: package org.incava.qualog;
02:
03: import java.io.*;
04: import java.util.*;
05:
06: /**
07: * Wraps Java maps for output.
08: */
09: public class QlMap {
10: public static boolean stack(QlLevel level, ANSIColor[] msgColors,
11: String name, Map map, ANSIColor fileColor,
12: ANSIColor classColor, ANSIColor methodColor, int numFrames) {
13: Set keySet = map.keySet();
14: Object[] keys = keySet.toArray();
15:
16: if (keys.length == 0) {
17: return Qualog.stack(level, msgColors, name, "()",
18: fileColor, classColor, methodColor, numFrames);
19: } else {
20: boolean ret = true;
21: for (int ki = 0; ki < keys.length; ++ki) {
22: int nFrames = ki == keys.length - 1 ? numFrames : 1;
23: ret = Qualog.stack(level, msgColors, name + "["
24: + keys[ki] + "]", map.get(keys[ki]), fileColor,
25: classColor, methodColor, nFrames);
26: }
27: return ret;
28: }
29: }
30: }
|