Interface Keys<K,V>

Type Parameters:
K - The type of the key.
V - The type of the value which relates to a key.
All Known Subinterfaces:
CanonicalTable, ClassStructTable, ImmutableCanonicalTable, ImmutableCanonicalTable.MutableCanonicalTable, ImmutableClassStructTable, ImmutableClassStructTable.MutableClassStructTable, ImmutableInterOperableTable<T>, ImmutableInterOperableTable.MutableInterOperableTable<T>, ImmutablePathTable<T>, ImmutablePathTable.MutablePathTable<T>, ImmutableSimpleTypeTable, ImmutableSimpleTypeTable.MutableSimpleTypeTable, ImmutableTable<K,V>, ImmutableTable.MutableTable<K,V>, InterOperableTable<T>, Keys.MutableKeys<K,V>, Keys.MutableValues<K,V>, PathTable<T>, SimpleTypeTable, Table<K,V,B>
All Known Implementing Classes:
MapCanonicalTable, MapClassStructTable, MapPathTable, MapSimpleTypeTable, UnmodifiableCanonicalTableDecorator, UnmodifiableClassStructTableDecorator, UnmodifiablePathTableDecorator, UnmodifiableSimpleTypeTableDecorator

public interface Keys<K,V>
This interface provides functionality for working with keys.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Adds mutable functionality to the Keys interface.
    static interface 
    Mixin for mutable functionality accompanying the Keys interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tests whether there is an element with the given key.
    boolean
    This method is defined for the sake of Map conformity.
    get(Object aKey)
    Retrieves the element assigned to the given key.
    default V
    getOr(Object aKey, V aDefaultValue)
    Retrieves the element assigned to the given key or the provided default value if there is no such value for the given key.
    Retrieves a collection containing all the keys found in the elements of this collection.
    Returns a Collection view of the values related to the contained keys.
  • Method Details

    • containsKey

      boolean containsKey(Object aKey)
      Tests whether there is an element with the given key.
      Parameters:
      aKey - The key for which to test whether there is an element.
      Returns:
      True in case there is an element for the given key.
    • containsValue

      boolean containsValue(Object aValue)
      This method is defined for the sake of Map conformity. Tests whether the provided value has a key assigned.
      Parameters:
      aValue - The value to test if a key references this value.
      Returns:
      True in case the given value is referenced by a key.
    • get

      V get(Object aKey)
      Retrieves the element assigned to the given key.
      Parameters:
      aKey - The key for which to get the element.
      Returns:
      The value for the key in question or null if there is none such value.
    • getOr

      default V getOr(Object aKey, V aDefaultValue)
      Retrieves the element assigned to the given key or the provided default value if there is no such value for the given key.
      Parameters:
      aKey - The key for which to get the element.
      aDefaultValue - The default value in case there is no such value for the given key.
      Returns:
      The value for the key in question or the default value if there is none such value.
    • keySet

      Set<K> keySet()
      Retrieves a collection containing all the keys found in the elements of this collection.
      Returns:
      A collection with key objects being the keys of all elements in this collection.
    • values

      Collection<V> values()
      Returns a Collection view of the values related to the contained keys.
      Returns:
      A Collection view of the values related to the contained keys.