Java collections framework: Difference between revisions

Content deleted Content added
AbstractSet: Add details about AbstractSet
Add information on CopyOnWriteArraySet. Add in-line citaiton
Line 169:
 
Direct subclasses of {{java|AbstractSet}} include {{java|ConcurrentSkipListSet}}, {{java|CopyOnWriteArraySet}}, {{java|EnumSet}}, {{java|HashSet}} and {{java|TreeSet}}.
 
====CopyOnWriteArraySet class====
{{code|CopyOnWriteArraySet}} is a concurrent replacement for a synchornized {{java|Set}}. It provides improved concurrency in many situations by removing the need to perform synchronization or making a copy of the object during iteration, similar to how {{code|CopyOnWriteArrayList}} acts as the concurrent replacement for a synchronized {{java|List}}.{{sfn|Goetz|Peierls|Bloch|Bowbeer|2006|loc=§5.2.3 CopyOnWriteArrayList|pp=86-89}}
On the other hand, similar to {{code|CopyOnWriteArrayList}}, {{code|CopyOnWriteArraySet}} should not be used when sychronization is mandatory.
 
=====HashSet class=====
Line 229 ⟶ 233:
==Citation==
{{Reflist|2}}
 
 
 
==References==
*{{cite book | title= "Effective Java: Programming Language Guide" |last=Bloch| first=Joshua| publisher=Addison-Wesley | edition=third | isbn=978-0134685991| year=2018}}
*{{cite book
| last = Goetz
| first = Brian
| last2 = Peierls
| first2 = Tim
| last3 = Bloch
| first3 = Joshua
| last4 = Bowbeer
| first4 = Joseph
| last5 = Holmes
| first5 = David
| last6 = Lea
| first6 = Doug
| year = 2006
| title = Java Concurrency in Practice
| publisher = Addison Wesley
| isbn = 0-321-34960-1
|ol=OL25208908M
| url=https://archive.org/details/javaconcurrencyi00goet
}}
 
{{wikibooks|Java Programming|Collections}}
{{Java (Sun)}}
 
 
{{Prone to spam|date=November 2018}}