Interface ReadOnlySequencedMap<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values
    All Superinterfaces:
    ReadOnlyMap<K,​V>
    All Known Subinterfaces:
    ReadOnlyNavigableMap<K,​V>, ReadOnlySortedMap<K,​V>
    All Known Implementing Classes:
    ReadOnlyTreeMap

    public interface ReadOnlySequencedMap<K,​V>
    extends ReadOnlyMap<K,​V>
    This interface was originally copied from GitHub's Open-JDK Account. Though the original file has been modified, few changes have been applied to the Javadoc Commenting. Due to fact that that is a Java interface file, there were few method bodies with Source-Code to begin with - meaning this is largely a copy of Method-Signatures and Java-Doc Comments.

    Method and parameter names & types have not been modified whatsoever; but several methods had to be eliminated for not being Read-Only. This Source-File was copied from the original Open JDK-21 file of the same (or, rather, highly similar) Interface-Name. The original file may be viewed on the JDK-21 GitHub public (and, coincidentally, Read-Only) Source-Release archive for Java Package java.util.*

    The Original '.java' Source-File's Header-Copyright Information is included here: File Copyright. Within that Copyright Notice, it is suggested that a copy of the GNU Public License V2 also be included alongside.
    Immutable variant of Java Collections Framework interface java.util.SequencedMap<K, V>. This interface contains all of the methods that the standard Java interface ReadOnlySequencedMap contains - except those which would directly or indirectly modify / mutate the internal data-structure.


    • Method Detail

      • reversed

        🡇     🗕  🗗  🗖
        ReadOnlySequencedMap<K,​Vreversed()
        Returns a reverse-ordered view of this map. The encounter order of mappings in the returned view is the inverse of the encounter order of mappings in this map. The reverse ordering affects all order-sensitive operations, including those on the view collections of the returned view.
        Returns:
        a reverse-ordered view of this map
      • firstEntry

        🡅  🡇     🗕  🗗  🗖
        default ReadOnlyMap.Entry<K,​VfirstEntry()
        Returns the first key-value mapping in this map, or null if the map is empty.
        Returns:
        the first key-value mapping, or null if this map is empty
        Code:
        Exact Method Body:
         RemoveUnsupportedIterator<ReadOnlyMap.Entry<K, V>> it = entrySet().iterator();
        
         return it.hasNext() ? it.next() : null;
         // return it.hasNext() ? new NullableKeyValueHolder<>(it.next()) : null;
        
      • lastEntry

        🡅  🡇     🗕  🗗  🗖
        default ReadOnlyMap.Entry<K,​VlastEntry()
        Returns the last key-value mapping in this map, or null if the map is empty.
        Returns:
        the last key-value mapping, or null if this map is empty
        Code:
        Exact Method Body:
         RemoveUnsupportedIterator<ReadOnlyMap.Entry<K, V>> it = reversed().entrySet().iterator();
        
         return it.hasNext() ? it.next() : null;
         // return it.hasNext() ? new NullableKeyValueHolder<>(it.next()) : null;
        
      • sequencedKeySet

        🡅  🡇     🗕  🗗  🗖
        default ReadOnlySequencedSet<KsequencedKeySet()
        Returns a SequencedSet view of this map's keySet.
        Returns:
        a SequencedSet view of this map's keySet
        Code:
        Exact Method Body:
         class ReadOnlySeqKeySet
             extends AbstractReadOnlyMap.ViewCollection<K>
             implements ReadOnlySequencedSet<K>
         {
             public ReadOnlyCollection<K> view()
             { return ReadOnlySequencedMap.this.keySet(); }
        
             public ReadOnlySequencedSet<K> reversed()
             { return ReadOnlySequencedMap.this.reversed().sequencedKeySet(); }
        
             public boolean equals(Object other)
             { return view().equals(other); }
        
             public int hashCode()
             { return view().hashCode(); }
         }
        
         return new ReadOnlySeqKeySet();
        
      • sequencedValues

        🡅  🡇     🗕  🗗  🗖
        default ReadOnlySequencedCollection<VsequencedValues()
        Returns a SequencedCollection view of this map's values collection.
        Returns:
        a SequencedCollection view of this map's values collection
        Code:
        Exact Method Body:
         class ReadOnlySeqValues
             extends AbstractReadOnlyMap.ViewCollection<V>
             implements ReadOnlySequencedCollection<V>
         {
             public ReadOnlyCollection<V> view()
             { return ReadOnlySequencedMap.this.values(); }
        
             public ReadOnlySequencedCollection<V> reversed()
             { return ReadOnlySequencedMap.this.reversed().sequencedValues(); }
         }
        
         return new ReadOnlySeqValues();
        
      • sequencedEntrySet

        🡅     🗕  🗗  🗖
        default ReadOnlySequencedSet<ReadOnlyMap.Entry<K,​V>> sequencedEntrySet()
        Returns a SequencedSet view of this map's entrySet.
        Returns:
        a SequencedSet view of this map's entrySet
        Code:
        Exact Method Body:
         class ReadOnlySeqEntrySet
             extends AbstractReadOnlyMap.ViewCollection<ReadOnlyMap.Entry<K, V>>
             implements ReadOnlySequencedSet<ReadOnlyMap.Entry<K, V>>
         {
             public ReadOnlyCollection<ReadOnlyMap.Entry<K, V>> view()
             { return ReadOnlySequencedMap.this.entrySet(); }
        
             public ReadOnlySequencedSet<ReadOnlyMap.Entry<K, V>> reversed()
             { return ReadOnlySequencedMap.this.reversed().sequencedEntrySet(); }
        
             public boolean equals(Object other)
             { return view().equals(other); }
        
             public int hashCode()
             { return view().hashCode(); }
         }
        
         return new ReadOnlySeqEntrySet();