MCPcopy Index your code
hub / github.com/davidgiven/luje / toString

Method toString

lib/java/util/AbstractMap.java:351–381  ·  view source on GitHub ↗

Returns the string representation of this map. @return the string representation of this map.

()

Source from the content-addressed store, hash-verified

349 * @return the string representation of this map.
350 */
351 @Override
352 public String toString() {
353 if (isEmpty()) {
354 return "{}"; //$NON-NLS-1$
355 }
356
357 StringBuilder buffer = new StringBuilder(size() * 28);
358 buffer.append('{');
359 Iterator<Map.Entry<K, V>> it = entrySet().iterator();
360 while (it.hasNext()) {
361 Map.Entry<K, V> entry = it.next();
362 Object key = entry.getKey();
363 if (key != this) {
364 buffer.append(key);
365 } else {
366 buffer.append("(this Map)"); //$NON-NLS-1$
367 }
368 buffer.append('=');
369 Object value = entry.getValue();
370 if (value != this) {
371 buffer.append(value);
372 } else {
373 buffer.append("(this Map)"); //$NON-NLS-1$
374 }
375 if (it.hasNext()) {
376 buffer.append(", "); //$NON-NLS-1$
377 }
378 }
379 buffer.append('}');
380 return buffer.toString();
381 }
382
383 /**
384 * Returns a collection of the values contained in this map. The collection

Callers

nothing calls this directly

Calls 10

isEmptyMethod · 0.95
sizeMethod · 0.95
appendMethod · 0.95
entrySetMethod · 0.95
toStringMethod · 0.95
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65

Tested by

no test coverage detected