Talk:Java collections framework
| This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
External links modified
[edit]Hello fellow Wikipedians,
I have just modified one external link on Java collections framework. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
- Added archive https://web.archive.org/web/20110807042032/http://www.digilife.be/quickreferences/PT/Java%20Collections%20Framework.pdf to http://www.digilife.be/quickreferences/PT/Java%20Collections%20Framework.pdf
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).
- If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
- If you found an error with any archives or the URLs themselves, you can fix them with this tool.
Cheers.—InternetArchiveBot (Report bug) 23:35, 19 April 2017 (UTC)
The "Stack" section is misleading
[edit]The Stack and Vector classes are not part of the Collections framework. They are legacy, from Java 1.0, and should not be used in new code. Suggest removing this section, or clarifying that these classes are _not_ to be used. 128.237.187.136 (talk) 16:09, 24 November 2017 (UTC)
Towards the end of this section, it states
"The usual push and pop operations are provided, as well as a method to peek at the top item on the stack, a method to test for whether the stack is empty, and a method to search the stack for an item and discover how far it is from the top."
It would be helpful to specify what these methods are.
Queue Interfaces
[edit]The sections states: "But it also has the Queue methods". Again, I think it would be helpful to specify what these methods are.
Also: The description of blocking queue is unclear. It states, very unhelpfully that additions and removals are "blocking"(???). This is not an explanation at all.
Figure of the Map class and interface hierarchy is incorrect
[edit]There is an issue in the figure of the java.util.Map class and interface hierarchy. NavigableMap and SortedMap are interfaces and should be marked with yellow circle rather than blue rectangle. This is misleading because it make you think that TreeMap may inherit from two classes, which is impossible in Java. — Preceding unsigned comment added by 132.64.34.178 (talk) 12:53, 27 June 2018 (UTC)
- I fixed this issue. Manuels World (talk) 15:53, 30 November 2024 (UTC)
java.util.Collection and java.util.Map images
[edit]Hi, I haven't edited Wikipedia in many years. I see the java.util.Collection and java.util.Map images are missing some of the classes referenced in the page, including HashSet, EnumSet, and EnumMap, among others. I did a quick check and there are many classes/interfaces that *could* be added. I assume the goal here is to show only the "important" ones rather than an exhaustive list? Is there support for adding these three classes? I don't want to spend a lot of time/energy editing the SVG files and then it gets rejected. Thanks.
Mattj2 (talk) 22:43, 5 October 2025 (UTC)
- Good point! HashSet should definitely be included.
- I'd say EnumMap and EnumSet are special cases that shouldn't be included. The diagrams also don't include IdentityHashMap and WeakHashMap, and that's fine. If we included all these special collections, the diagrams would become bloated. But if others feel EnumMap/Set should be included, I could live with that as well.
- While you're at it, I'd suggest the following additional changes to the diagrams:
- Below HashSet, also include LinkedHashSet.
- In the Collection diagram, also include SequencedCollection and SequencedSet.
- In the Map diagram, move the Sequenced/Sorted/NavigableMap inheritance line from the right to the left, to make it look very similar to the corresponding part of the Collection diagram.
- The Map and Set hierarchies are exactly parallel, and the diagram layout should make that more obvious.
- What do you think? I'd be happy to help with editing the SVGs.
- — Chrisahn (talk) 20:09, 6 October 2025 (UTC)
- Thanks Chrisahn! That all sounds great. I'd really appreciate if you can edit the SVGs. I'm between jobs, and this is something that I think can be improved, but it's also totally a distraction from other things I "should" be working on. Mainly I'm worried that if I edit the SVGs myself it will set off too many Wikipedia alarms because I contribute so rarely. Like you said, if every class is included then the diagrams will be too bloated.
- Mattj2 (talk) 02:33, 13 October 2025 (UTC)
- I reworked the Map image and started working on the Collection image, but it's going to take a while. — Chrisahn (talk) 09:51, 14 October 2025 (UTC)
- In the end, I put all classes of the collections framework into one diagram. They're all members of the framework, no matter which interfaces they implement. As discussed above, I omitted EnumSet, EnumMap, IdentityHashMap and a few others whose Javadoc says "this class is a member of the Java Collections Framework", simply because the diagram is getting crowded. I also omitted AbstractSequentialList and drew an "extends" arrow from LinkedList directly to AbstractList. Not quite correct, but AbstractSequentialList seemed to be of low relevance, and I couldn't find space for it in the diagram... — Chrisahn (talk) 23:29, 16 October 2025 (UTC)
- ...and while I wrote the last comment, I thought about EnumMap and EnumSet again. I guess they're more important than IdentityHashMap and WeakHashMap, and I think more Java developers should know about them, and I realized I could squeeze them into the diagram without much hassle, so I added them after all. :-) — Chrisahn (talk) 23:53, 16 October 2025 (UTC)
- In the end, I put all classes of the collections framework into one diagram. They're all members of the framework, no matter which interfaces they implement. As discussed above, I omitted EnumSet, EnumMap, IdentityHashMap and a few others whose Javadoc says "this class is a member of the Java Collections Framework", simply because the diagram is getting crowded. I also omitted AbstractSequentialList and drew an "extends" arrow from LinkedList directly to AbstractList. Not quite correct, but AbstractSequentialList seemed to be of low relevance, and I couldn't find space for it in the diagram... — Chrisahn (talk) 23:29, 16 October 2025 (UTC)
- I reworked the Map image and started working on the Collection image, but it's going to take a while. — Chrisahn (talk) 09:51, 14 October 2025 (UTC)
