aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes LinkedHashSet and LinkedHashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "LinkedHashSet and LinkedHashMap" Watch "LinkedHashSet and LinkedHashMap" New topic
Author

LinkedHashSet and LinkedHashMap

Sim Kim
Ranch Hand

Joined: Aug 06, 2004
Posts: 268
For LinkedHashMap the Java API says
A special constructor is provided to create a linked hash map whose order of iteration is the order in which its entries were last accessed, from least-recently accessed to most-recently (access-order). This kind of map is well-suited to building LRU caches.


Does LinkedHashSet also has the same facility ? According to Kathy and Bert's book they say that you can access elements by two ways in LinkedHashSet : one by insertion order and other by last accessorder . How can you use that ?
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
I saw it in K&B, but I didn't see it in the API doc or in the source code.


Mike Gershman
SCJP 1.4, SCWCD in process
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

According to Kathy and Bert's book they say that you can access elements by two ways in LinkedHashSet : one by insertion order and other by last accessorder


For last access oprder , Please read my thread posted on LinkedHashSet.


Groovy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LinkedHashSet and LinkedHashMap
 
Similar Threads
Does LinkedHashSet support last accessed order?
collecition class
Sorting question
LinkedHashSet
Another errata entry to SCJP Study Guide 1.4?