Class ISetMaps

java.lang.Object
org.javimmutable.collections.ISetMaps

public final class ISetMaps extends Object
  • Method Details

    • hashed

      @Nonnull public static <K, V> ISetMap<K,V> hashed()
      Creates a set map with higher performance but no specific ordering of keys. Sets for each key are equivalent to one created by ISets.hashed().
    • ordered

      @Nonnull public static <K, V> ISetMap<K,V> ordered()
      Creates a set map with keys sorted by order they are inserted. Sets for each value are equivalent to one created by ISets.ordered().
    • sorted

      @Nonnull public static <K extends Comparable<K>, V> ISetMap<K,V> sorted()
      Creates a set map with keys sorted by their natural ordering. Sets for each key are equivalent to one created by ISets.sorted().
    • sorted

      @Nonnull public static <K, V> ISetMap<K,V> sorted(@Nonnull Comparator<K> comparator)
      Creates a set map with keys sorted by the specified Comparator. The Comparator MUST BE IMMUTABLE. Sets for each value are equivalent to one created by ISets.sorted(Comparator).
    • templated

      @Nonnull public static <K, V> ISetMap<K,V> templated(@Nonnull IMap<K,ISet<V>> templateMap, @Nonnull ISet<V> templateSet)
      Creates a set map using the provided templates for map and set. The templates do not have to be empty. The set map will always use empty versions of them internally. This factory method provided complete flexibility in the choice of map and set types by caller.
      Parameters:
      templateMap - instance of the type of map to use
      templateSet - instance of the type of set to use
    • factory

      @Nonnull public static <K, V> SetMapFactory<K,V> factory()
      Creates a builder to build a custom ISetMap configuration from a base map and set type.
    • factory

      @Nonnull public static <K, V> SetMapFactory<K,V> factory(@Nonnull Class<K> keyClass, @Nonnull Class<V> valueClass)
      Creates a builder to build a custom ISetMap configuration from a base map and set type. The provided classes are used to tell the java type system what the target times are. Sometimes this can be more convenient than angle brackets.