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 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos