MCPcopy Create free account
hub / github.com/M66B/FairEmail / toString

Method toString

app/src/main/java/com/sun/mail/imap/protocol/UIDSet.java:123–150  ·  view source on GitHub ↗

Convert an array of UIDSets into an IMAP sequence range. @param uidset the UIDSets @return the IMAP sequence string

(UIDSet[] uidset)

Source from the content-addressed store, hash-verified

121 * @return the IMAP sequence string
122 */
123 public static String toString(UIDSet[] uidset) {
124 if (uidset == null)
125 return null;
126 if (uidset.length == 0) // Empty uidset
127 return "";
128
129 int i = 0; // uidset index
130 StringBuilder s = new StringBuilder();
131 int size = uidset.length;
132 long start, end;
133
134 for (;;) {
135 start = uidset[i].start;
136 end = uidset[i].end;
137
138 if (end > start)
139 s.append(start).append(':').append(end);
140 else // end == start means only one element
141 s.append(start);
142
143 i++; // Next UIDSet
144 if (i >= size) // No more UIDSets
145 break;
146 else
147 s.append(',');
148 }
149 return s.toString();
150 }
151
152 /**
153 * Convert an array of UIDSets into a array of long UIDs.

Callers 15

setFlagsMethod · 0.95
copyMessagesMethod · 0.95
setFlagsMethod · 0.95
copymoveMessagesMethod · 0.95
resyncArgsMethod · 0.95
uidexpungeMethod · 0.95
generateSequenceMethod · 0.45
isAsciiMethod · 0.45
toIMAPDateMethod · 0.45
fetchSequenceNumbersMethod · 0.45
createFlagListMethod · 0.45
sortMethod · 0.45

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected