Proposal for enhancing the Java programming language would define interfaces for sequenced collections, sequenced sets, and sequenced maps. Credit: Thinkstock Addressing an issue that has been a source of ongoing complaints, Java could add sequenced collections, sequenced sets, and sequenced maps, anchored by interfaces to represent collections with a defined encounter order. A proposal pending in the OpenJDK community would define interfaces for sequenced collections, sequenced sets, and sequenced maps, and retrofit them into the existing collections type hierarchy. Motivating the plan are two gaps in Java’s collections framework, the language’s architecture for representing and manipulating collections: It lacks a collection type that represents a sequence of elements with a defined encounter order, and it lacks a uniform set of operations that apply across such operations. These gaps, the proposal states, have been a repeated source of complaints and problems. For example, although List and Deque both define an encounter order, their common supertype, Collection, does not. With the sequenced collections proposal, all of the new methods declared in the new interfaces have default implementations. Sequenced collections would be added to the standard edition of Java. The earliest it could arrive would be with JDK 20, due next March, with JDK 19 having just arrived last month as part of standard Java’s six-month release cadence. A sequenced collection is defined as a Collection whose elements have a defined encounter order. Such a collection has first and last elements, and elements between them have successors and predecessors. Common operations are supported at either end of a sequenced collection. Processing of elements from first to last and from last to first are supported. The proposal marks an incremental evolution of the ReversibleCollections proposal from 2021, to add a ReversibleCollections interface to the collections framework. Related content feature What is Rust? Safe, fast, and easy software development Unlike most programming languages, Rust doesn't make you choose between speed, safety, and ease of use. Find out how Rust delivers better code with fewer compromises, and a few downsides to consider before learning Rust. By Serdar Yegulalp Nov 20, 2024 11 mins Rust Programming Languages Software Development how-to Kotlin for Java developers: Classes and coroutines Kotlin was designed to bring more flexibility and flow to programming in the JVM. Here's an in-depth look at how Kotlin makes working with classes and objects easier and introduces coroutines to modernize concurrency. By Matthew Tyson Nov 20, 2024 9 mins Java Kotlin Programming Languages analysis Azure AI Foundry tools for changes in AI applications Microsoft’s launch of Azure AI Foundry at Ignite 2024 signals a welcome shift from chatbots to agents and to using AI for business process automation. By Simon Bisson Nov 20, 2024 7 mins Microsoft Azure Generative AI Development Tools news Microsoft unveils imaging APIs for Windows Copilot Runtime Generative AI-backed APIs will allow developers to build image super resolution, image segmentation, object erase, and OCR capabilities into Windows applications. By Paul Krill Nov 19, 2024 2 mins Generative AI APIs Development Libraries and Frameworks Resources Videos