MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / toString

Method toString

Ports/CLDC11/src/java/util/BitSet.java:890–914  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

888 ///
889 /// a comma delimited list of the indices of all bits that are set.
890 @Override
891 public String toString() {
892 StringBuffer sb = new StringBuffer(bits.length / 2);
893 int bitCount = 0;
894 sb.append('{');
895 boolean comma = false;
896 for (int i = 0; i < bits.length; i++) {
897 if (bits[i] == 0) {
898 bitCount += ELM_SIZE;
899 continue;
900 }
901 for (int j = 0; j < ELM_SIZE; j++) {
902 if (((bits[i] & (TWO_N_ARRAY[j])) != 0)) {
903 if (comma) {
904 sb.append(", "); //$NON-NLS-1$
905 }
906 sb.append(bitCount);
907 comma = true;
908 }
909 bitCount++;
910 }
911 }
912 sb.append('}');
913 return sb.toString();
914 }
915
916 /// Returns the position of the first bit that is `true` on or after `pos`.
917 ///

Callers

nothing calls this directly

Calls 2

appendMethod · 0.95
toStringMethod · 0.95

Tested by

no test coverage detected