• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

Révision4ec4f2994a9482a8ebd904b19df10b9c057b9640 (tree)
l'heure2013-07-07 00:17:39
Auteurkobayasi <kobayasi@pscn...>
Commiterkobayasi

Message de Log

update SafeArrayList

Change Summary

Modification

--- a/engine/src/core/com/jme3/util/SafeArrayList.java
+++ b/engine/src/core/com/jme3/util/SafeArrayList.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright (c) 2009-2011 jMonkeyEngine
2+ * Copyright (c) 2009-2012 jMonkeyEngine
33 * All rights reserved.
44 *
55 * Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,6 @@
2929 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3030 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131 */
32-
3332 package com.jme3.util;
3433
3534 import java.util.*;
@@ -66,7 +65,7 @@ import java.util.*;
6665 * original snapshot.
6766 * </ul>
6867 *
69- * @version $Revision: 7856 $
68+ * @version $Revision$
7069 * @author Paul Speed
7170 */
7271 public class SafeArrayList<E> implements List<E> {
@@ -320,6 +319,25 @@ public class SafeArrayList<E> implements List<E> {
320319 return Collections.unmodifiableList(raw);
321320 }
322321
322+ public String toString() {
323+
324+ E[] array = getArray();
325+ if( array.length == 0 ) {
326+ return "[]";
327+ }
328+
329+ StringBuilder sb = new StringBuilder();
330+ sb.append('[');
331+ for( int i = 0; i < array.length; i++ ) {
332+ if( i > 0 )
333+ sb.append( ", " );
334+ E e = array[i];
335+ sb.append( e == this ? "(this Collection)" : e );
336+ }
337+ sb.append(']');
338+ return sb.toString();
339+ }
340+
323341 protected class ArrayIterator<E> implements ListIterator<E> {
324342 private E[] array;
325343 private int next;