Changeset 6004


Ignore:
Timestamp:
02/27/04 14:32:11 (17 years ago)
Author:
piso
Message:

Moved toString() to AbstractVector?.java.

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/ComplexVector.java

    r5968 r6004  
    33 *
    44 * Copyright (C) 2002-2004 Peter Graves
    5  * $Id: ComplexVector.java,v 1.10 2004-02-25 17:29:17 piso Exp $
     5 * $Id: ComplexVector.java,v 1.11 2004-02-27 14:32:11 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    251251        }
    252252        return this;
    253     }
    254 
    255     public String toString()
    256     {
    257         StringBuffer sb = new StringBuffer("#(");
    258         try {
    259             // FIXME The limit should be based on the value of *PRINT-LENGTH*.
    260             final int limit = Math.min(length(), 10);
    261             for (int i = 0; i < limit; i++) {
    262                 if (i > 0)
    263                     sb.append(' ');
    264                 sb.append(get(i));
    265             }
    266             if (limit < length())
    267                 sb.append(" ...");
    268             sb.append(')');
    269         }
    270         catch (ConditionThrowable t) {
    271             // Shouldn't happen.
    272             Debug.trace(t);
    273         }
    274         return sb.toString();
    275253    }
    276254
  • trunk/j/src/org/armedbear/lisp/SimpleVector.java

    r5992 r6004  
    33 *
    44 * Copyright (C) 2002-2004 Peter Graves
    5  * $Id: SimpleVector.java,v 1.9 2004-02-26 02:17:08 piso Exp $
     5 * $Id: SimpleVector.java,v 1.10 2004-02-27 14:31:54 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    226226    }
    227227
    228     public String toString()
    229     {
    230         StringBuffer sb = new StringBuffer("#(");
    231         // FIXME The limit should be based on the value of *PRINT-LENGTH*.
    232         final int limit = Math.min(capacity, 10);
    233         for (int i = 0; i < limit; i++) {
    234             if (i > 0)
    235                 sb.append(' ');
    236             sb.append(elements[i]);
    237         }
    238         if (limit < length())
    239             sb.append(" ...");
    240         sb.append(')');
    241         return sb.toString();
    242     }
    243 
    244228    public AbstractVector adjustVector(int newCapacity,
    245229                                       LispObject initialElement,
Note: See TracChangeset for help on using the changeset viewer.