Package smile.hash

Class PerfectMap.Builder<T>

java.lang.Object
smile.hash.PerfectMap.Builder<T>
Type Parameters:
T - the data type of set objects.
Enclosing class:
PerfectMap<T>

public static class PerfectMap.Builder<T> extends Object
The builder of perfect map.
  • Constructor Details

    • Builder

      public Builder()
      Constructor.
    • Builder

      public Builder(Map<String,T> map)
      Constructor.
      Parameters:
      map - the initialization map.
  • Method Details

    • add

      public PerfectMap.Builder<T> add(String key, T value)
      Add a new key-value pair.
      Parameters:
      key - the key.
      value - the value.
      Returns:
      this builder.
    • build

      public PerfectMap<T> build()
      Builds the perfect map.
      Returns:
      the perfect map.