Package org.javimmutable.collections
Class ISetMaps
java.lang.Object
org.javimmutable.collections.ISetMaps
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> SetMapFactory <K, V> factory()
Creates a builder to build a customISetMap
configuration from a base map and set type.static <K,
V> SetMapFactory <K, V> Creates a builder to build a customISetMap
configuration from a base map and set type.static <K,
V> ISetMap <K, V> hashed()
Creates a set map with higher performance but no specific ordering of keys.static <K,
V> ISetMap <K, V> ordered()
Creates a set map with keys sorted by order they are inserted.static <K extends Comparable<K>,
V>
ISetMap<K, V> sorted()
Creates a set map with keys sorted by their natural ordering.static <K,
V> ISetMap <K, V> sorted
(Comparator<K> comparator) Creates a set map with keys sorted by the specified Comparator.static <K,
V> ISetMap <K, V> Creates a set map using the provided templates for map and set.
-
Method Details
-
hashed
Creates a set map with higher performance but no specific ordering of keys. Sets for each key are equivalent to one created byISets.hashed()
. -
ordered
Creates a set map with keys sorted by order they are inserted. Sets for each value are equivalent to one created byISets.ordered()
. -
sorted
Creates a set map with keys sorted by their natural ordering. Sets for each key are equivalent to one created byISets.sorted()
. -
sorted
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 byISets.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 usetemplateSet
- instance of the type of set to use
-
factory
Creates a builder to build a customISetMap
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 customISetMap
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.
-