🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18379

Integer to string conversions

#18379
From: Alexander Anguiano
Date: Mon, 06 Jul 1998 00:00
33 lines
1443 bytes
I was working with a Integer object and I was trying to create a comma
delimited string

efficiently. Is there another way to convert integers to strings?  (The
Integer class only

allows me to set the value at construction time.)

Have ---
 BitSet recordMap ....


    for(int i = 0; i < recordMap.size(); i++) {
      if (recordMap.get(i)) {
        Integer recordNumber = new Integer(i);
        if (result.length() == 0)
          result.append(recordNumber.toString());
        else result.append(','+ recordNumber.toString());
      } // if
    } // for

Want something like this

    Integer recordNumber = new Integer();
    for(int i = 0; i < recordMap.size(); i++) {
      if (recordMap.get(i)) {
        recordNumber.setValue(i); //<------------ something like this
        if (result.length() == 0)
          result.append(recordNumber.toString());
        else result.append(','+ recordNumber.toString());
      } // if
    } // for
Technical Details
Message-ID: <6nqmqm$16c@bgtnsc03.worldnet.att.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,e6efa13a8396e245,start
X-Google-Attributes: gidf74b3,public
From: "Alexander Anguiano" <AlexAnguiano@worldnet.att.net>
Subject: Integer to string conversions
Date: 1998/07/06
Message-ID: <6nqmqm$16c@bgtnsc03.worldnet.att.net>
X-Deja-AN: 368902438
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: AT&T WorldNet Services
Newsgroups: borland.public.jbuilder.java.language