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

Method toString

Ports/CLDC11/src/java/util/Vector.java:1150–1173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1148 ///
1149 /// - #elements
1150 @Override
1151 public synchronized String toString() {
1152 if (elementCount == 0) {
1153 return "[]"; //$NON-NLS-1$
1154 }
1155 int length = elementCount - 1;
1156 StringBuffer buffer = new StringBuffer(elementCount * 16);
1157 buffer.append('[');
1158 for (int i = 0; i < length; i++) {
1159 if (elementData[i] == this) {
1160 buffer.append("(this Collection)"); //$NON-NLS-1$
1161 } else {
1162 buffer.append(elementData[i]);
1163 }
1164 buffer.append(", "); //$NON-NLS-1$
1165 }
1166 if (elementData[length] == this) {
1167 buffer.append("(this Collection)"); //$NON-NLS-1$
1168 } else {
1169 buffer.append(elementData[length]);
1170 }
1171 buffer.append(']');
1172 return buffer.toString();
1173 }
1174
1175 /// Sets the capacity of this vector to be the same as the size.
1176 ///

Callers

nothing calls this directly

Calls 2

appendMethod · 0.95
toStringMethod · 0.95

Tested by

no test coverage detected