Class DictKeys

java.lang.Object
src.DictKeys
All Implemented Interfaces:
Iterable<Object>

public class DictKeys extends Object implements Iterable<Object>
DictKeys is a class that represents a collection of keys in a dictionary. It implements the Iterable interface, allowing iteration over the keys in the collection.
  • Constructor Details

    • DictKeys

      public DictKeys(Object[] keys)
  • Method Details

    • length

      public int length()
      Returns the number of keys in the collection.
      Returns:
      the number of keys
    • toArray

      public Object[] toArray()
      Returns a copied list of the dictionary keys.
      Returns:
      a copy of the dictionary keys
    • iterator

      public Iterator<Object> iterator()
      Returns an iterator over the keys in the collection.
      Specified by:
      iterator in interface Iterable<Object>
      Returns:
      an iterator over the keys
    • toString

      public String toString()
      Returns a string representation of the keys in the collection.
      Overrides:
      toString in class Object
      Returns:
      the string representation of the keys
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object