Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
VCollections – Release 1
Interface org.violetlib.collections.MapBuilder
Inherited members: ShowHide
Deprecated: ShowHide
org.violetlib.collections

Interface MapBuilder<K,V>

  • Type Parameters:
    K - The type of the keys.
    V - The type of the values.
    public interface MapBuilder<K,V>
    An interface for a map builder. A map builder is a mutable object that accepts a sequence of bindings and creates a map containing those bindings.
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator add Reveal DetailHide Detail
      abstract void add(Binding<? extends K,? extends V> binding)
      Add a binding to be included in the map, replacing any previously added binding with the same key.
      void add(Binding<? extends K,? extends V> binding)
      Add a binding to be included in the map, replacing any previously added binding with the same key.
      Parameters:
      binding - The binding to be added.
      Ordinary member indicator addAll Reveal DetailHide Detail
      void addAll(Iterable<Binding<K,V>> it)
      A convenience method to add a collection of bindings.
      void addAll(Iterable<Binding<K,V>> it) throws IllegalArgumentException
      A convenience method to add a collection of bindings.
      Parameters:
      it - The iterable collection that provides the bindings.
      Throws:
      IllegalArgumentException - if the sequence contains a null element or an entry with a null key or value.
      Ordinary member indicator addEntries Reveal DetailHide Detail
      void addEntries(Iterable<Map.Entry<? extends K,? extends V>> it)
      A convenience method to add a collection of bindings.
      void addEntries(Iterable<Map.Entry<? extends K,? extends V>> it) throws IllegalArgumentException
      A convenience method to add a collection of bindings.
      Parameters:
      it - The iterable collection that provides the bindings.
      Throws:
      IllegalArgumentException - if the sequence contains a null element or an entry with a null key or value.
      Ordinary member indicator containsKey Reveal DetailHide Detail
      abstract boolean containsKey(K key)
      Indicate whether or not a binding is specified for a key.
      boolean containsKey(K key)
      Indicate whether or not a binding is specified for a key.
      Parameters:
      key - The key.
      Returns:
      true if and only if a binding is specified for the key.
      Ordinary member indicator get Reveal DetailHide Detail
      abstract V get(K key)
      Return the value currently bound to a key
      V get(K key)
      Return the value currently bound to a key
      Parameters:
      key - The key.
      Returns:
      the associated value, or null if none.
      Ordinary member indicator isEmpty Reveal DetailHide Detail
      abstract boolean isEmpty()
      Indicate whether the map created in the current state would be empty.
      boolean isEmpty()
      Indicate whether the map created in the current state would be empty.
      Returns:
      true if and only if the map would be empty.
      Ordinary member indicator put Reveal DetailHide Detail
      abstract void put(K key, V value)
      Add a binding to be included in the map, replacing any previously added binding with the same key.
      void put(K key, V value)
      Add a binding to be included in the map, replacing any previously added binding with the same key.
      Parameters:
      key - The key.
      value - The value.
      Ordinary member indicator putOptional Reveal DetailHide Detail
      void putOptional(K key, V value)
      Optionally add a binding to be included in the map, replacing any previously added binding with the same key.
      void putOptional(K key, V value)
      Optionally add a binding to be included in the map, replacing any previously added binding with the same key.
      Parameters:
      key - The key.
      value - The value. If null, this method has no effect.
      Ordinary member indicator reset Reveal DetailHide Detail
      abstract void reset()
      Remove all previously supplied bindings.
      void reset()
      Remove all previously supplied bindings.
      Ordinary member indicator size Reveal DetailHide Detail
      abstract int size()
      Return the number of bindings that would be contained in the map created in the current state.
      int size()
      Return the number of bindings that would be contained in the map created in the current state.
      Returns:
      the number of elements.
      Ordinary member indicator value Reveal DetailHide Detail
      abstract IMap<K,V> value()
      Return a map containing the previously supplied (and not removed) bindings.
      IMap<K,V> value()
      Return a map containing the previously supplied (and not removed) bindings.
      Returns:
      the map.