src/java.desktop/share/classes/javax/swing/event/TreeModelEvent.java

Print this page
rev 10521 : 8055723[client]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


 277     public int[] getChildIndices() {
 278         if(childIndices != null) {
 279             int            cCount = childIndices.length;
 280             int[]          retArray = new int[cCount];
 281 
 282             System.arraycopy(childIndices, 0, retArray, 0, cCount);
 283             return retArray;
 284         }
 285         return null;
 286     }
 287 
 288     /**
 289      * Returns a string that displays and identifies this object's
 290      * properties.
 291      *
 292      * @return a String representation of this object
 293      */
 294     public String toString() {
 295         StringBuilder   sb = new StringBuilder();
 296 
 297         sb.append(getClass().getName() + " " +
 298                   Integer.toString(hashCode()));
 299         if(path != null)
 300             sb.append(" path " + path);
 301         if(childIndices != null) {
 302             sb.append(" indices [ ");
 303             for(int counter = 0; counter < childIndices.length; counter++)
 304                 sb.append(Integer.toString(childIndices[counter])+ " ");
 305             sb.append("]");
 306         }
 307         if(children != null) {
 308             sb.append(" children [ ");
 309             for(int counter = 0; counter < children.length; counter++)
 310                 sb.append(children[counter] + " ");
 311             sb.append("]");
 312         }
 313         return sb.toString();
 314     }
 315 }


 277     public int[] getChildIndices() {
 278         if(childIndices != null) {
 279             int            cCount = childIndices.length;
 280             int[]          retArray = new int[cCount];
 281 
 282             System.arraycopy(childIndices, 0, retArray, 0, cCount);
 283             return retArray;
 284         }
 285         return null;
 286     }
 287 
 288     /**
 289      * Returns a string that displays and identifies this object's
 290      * properties.
 291      *
 292      * @return a String representation of this object
 293      */
 294     public String toString() {
 295         StringBuilder   sb = new StringBuilder();
 296 
 297         sb.append(getClass().getName()).append(' ').append(hashCode());

 298         if(path != null)
 299             sb.append(" path ").append(path);
 300         if(childIndices != null) {
 301             sb.append(" indices [ ");
 302             for(int counter = 0; counter < childIndices.length; counter++)
 303                 sb.append(childIndices[counter]).append(' ');
 304             sb.append(']');
 305         }
 306         if(children != null) {
 307             sb.append(" children [ ");
 308             for(int counter = 0; counter < children.length; counter++)
 309                 sb.append(children[counter]).append(' ');
 310             sb.append(']');
 311         }
 312         return sb.toString();
 313     }
 314 }