Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Java 21

To run each example use: java --enable-preview --source 20 <FileName.java>

JEPs

JEPs proposed to target:

  • 431 - Sequenced Collections

Features

  • Sequenced Collections
    • new interfaces to define a common way to iterate throught sequenced collections (list, sets and maps)
    • collections type hierarchy with new interfaces
    • sequenced collection:
      • a sequenced collection is a collection whose elements have a defined encounter order
      • sequenced collection has a first and last elements, and the elements between them have successors and predecessors
      • it supports common operations at the beginning and the end of the collection, also allow iterate it forward or backward
      • methods from SequencedCollection<E> interface:
        • reversed
        • addFirst
        • addLast
        • getFirst
        • getLast
        • removeFirst
        • removeLast
    • sequenced set:
      • sequenced set is a set that is sequenced collcetion that do not allow duplicate elements
      • methods from SequencedSet<E> interface:
        • reversed
    • sequenced map:
      • sequenced map is a map whose entries have a defined encounter order
      • methods from SequencedMap<K,V> interface:
        • reversed
        • sequencedKeySet
        • sequencedValues
        • sequencedEntrySet
        • putFirst
        • putLast
        • firstEntry
        • lastEntry
        • pollFirstEntry
        • pollLastEntry
    • new methods in Collections:
      • unmodifiableSequencedCollection
      • unmodifiableSequencedSet
      • unmodifiableSequencedMap

Links