Interface ReadOnlyDictionary<K,​V>

  • Type Parameters:
    K - the type of keys
    V - the type of mapped values
    All Known Implementing Classes:
    ReadOnlyHashtable, ReadOnlyProperties

    public interface ReadOnlyDictionary<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 abstract class java.util.Dictionary<K, V>. This abstract class contains all of the methods that the standard Java abstract class ReadOnlyDictionary contains - except those which would directly or indirectly modify / mutate the internal data-structure.


    • Method Summary

       
      Retrieve a Dictionary Value
      Modifier and Type Method
      V get​(Object key)
       
      Retrieve an Enumeration of Dictionary Keys
      Modifier and Type Method
      Enumeration<K> keys()
       
      Retrieve an Enumeration of Dictionary Values
      Modifier and Type Method
      Enumeration<V> elements()
       
      Check this Dictionary's Contents
      Modifier and Type Method
      boolean isEmpty()
      int size()
    • Method Detail

      • size

        🡇     🗕  🗗  🗖
        int size()
        Returns the number of entries (distinct keys) in this dictionary.
        Returns:
        the number of keys in this dictionary.
      • isEmpty

        🡅  🡇     🗕  🗗  🗖
        boolean isEmpty()
        Tests if this dictionary maps no keys to value. The general contract for the isEmpty method is that the result is true if and only if this dictionary contains no entries.
        Returns:
        true if this dictionary maps no keys to values; false otherwise.
      • keys

        🡅  🡇     🗕  🗗  🗖
        java.util.Enumeration<Kkeys()
        Returns an enumeration of the keys in this dictionary. The general contract for the keys method is that an Enumeration object is returned that will generate all the keys for which this dictionary contains entries.
        Returns:
        an enumeration of the keys in this dictionary.
        See Also:
        elements()
      • elements

        🡅  🡇     🗕  🗗  🗖
        java.util.Enumeration<Velements()
        Returns an enumeration of the values in this dictionary. The general contract for the elements method is that an Enumeration is returned that will generate all the elements contained in entries in this dictionary.
        Returns:
        an enumeration of the values in this dictionary.
        See Also:
        keys()
      • get

        🡅     🗕  🗗  🗖
        V get​(java.lang.Object key)
        Returns the value to which the key is mapped in this dictionary. The general contract for the isEmpty method is that if this dictionary contains an entry for the specified key, the associated value is returned; otherwise, null is returned.
        Parameters:
        key - a key in this dictionary. null if the key is not mapped to any value in this dictionary.
        Returns:
        the value to which the key is mapped in this dictionary;
        Throws:
        java.lang.NullPointerException - if the key is null.