MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / getMessages

Method getMessages

src/org/albite/util/BufferedLogger.java:44–72  ·  view source on GitHub ↗
(
            final boolean errorOnly, final boolean ascending)

Source from the content-addressed store, hash-verified

42 }
43
44 public final String getMessages(
45 final boolean errorOnly, final boolean ascending) {
46
47 StringBuffer sb = new StringBuffer();
48 Message m;
49
50 final int end = messages.size() - 1;
51
52 int i = (ascending ? 0 : end - 1);
53 while (
54 (ascending && i <= end) ||
55 (!ascending && i >= 0)
56 ) {
57
58 m = (Message) messages.elementAt(i);
59 if (!errorOnly || m.error) {
60 sb.append(m.msg);
61 sb.append('\n');
62 }
63
64 if (ascending) {
65 i++;
66 } else {
67 i--;
68 }
69 }
70
71 return sb.toString();
72 }
73
74 public final boolean isEmpty() {
75 return messages.isEmpty();

Callers 1

exitMIDletMethod · 0.80

Calls 2

toStringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected