🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Unique list

#466
From: Alexey N. Solofnenko
Date: Fri, 15 Apr 2005 15:54
25 lines
1569 bytes
... or LinkedHashSet, if order is important.

- Alexey.

Lori M Olson [TeamB] wrote:
> Petar Popara wrote:
> 
>>     I need a class (something like ArrayList), where I would add 
>> objects and it would not accept same object twice (it would only keep 
>> one reference of each object). Does something like this exists?
>>
>> Example:
>>
>> ArrayList a = new ArrayList();
>> Integer i = new Integer(777);
>> a.add(i);
>> a.add(i); //ignore it
>> a.add(i); //ignore it
>> ...
>>
> 
> Then you don't need a "list".  You need a "set".
> 
> http://java.sun.com/j2se/1.4.2/docs/api/java/util/Set.html
> 
Technical Details
Message-ID: <425fe3c9$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <425fb3b7$1@newsgroups.borland.com> <425fc17a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,a1404464e923cc6d
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 15 Apr 2005 08:54:51 -0700
From: "Alexey N. Solofnenko" <trelony@mail.ru>
User-Agent: Mozilla Thunderbird  (Windows/20050412)
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Unique list
References: <425fb3b7$1@newsgroups.borland.com> <425fc17a@newsgroups.borland.com>
In-Reply-To: <425fc17a@newsgroups.borland.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.200.221.5
Message-ID: <425fe3c9$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1113580489 208.200.221.5 (15 Apr 2005 08:54:49 -0800)
Lines: 25
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail