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

Method toString

Ports/CLDC11/src/java/util/AbstractMap.java:621–651  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

619 ///
620 /// the string representation of this map.
621 @Override
622 public String toString() {
623 if (isEmpty()) {
624 return "{}"; //$NON-NLS-1$
625 }
626
627 StringBuffer buffer = new StringBuffer(size() * 28);
628 buffer.append('{');
629 Iterator<Map.Entry<K, V>> it = entrySet().iterator();
630 while (it.hasNext()) {
631 Map.Entry<K, V> entry = it.next();
632 Object key = entry.getKey();
633 if (key != this) {
634 buffer.append(key);
635 } else {
636 buffer.append("(this Map)"); //$NON-NLS-1$
637 }
638 buffer.append('=');
639 Object value = entry.getValue();
640 if (value != this) {
641 buffer.append(value);
642 } else {
643 buffer.append("(this Map)"); //$NON-NLS-1$
644 }
645 if (it.hasNext()) {
646 buffer.append(", "); //$NON-NLS-1$
647 }
648 }
649 buffer.append('}');
650 return buffer.toString();
651 }
652
653 /// Returns a collection of the values contained in this map. The collection
654 /// is backed by this map so changes to one are reflected by the other. The

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