Example #1
0
        internal static Map <K, T> toMapWithKey <T, K>(Iterable <T> iterable, Function <T, K> function)
        {
            var dictionary = FromJava.IterableToEnumerable(iterable)
                             .ToDictionary(function.apply);

            return(ToJava.DictionaryToMap(dictionary));
        }
Example #2
0
 internal static Map <K, V> map <K, V>(K key1, V value1, K key2, V value2)
 {
     return(ToJava.DictionaryToMap(new System.Collections.Generic.Dictionary <K, V> {
         { key1, value1 },
         { key2, value2 }
     }));
 }
Example #3
0
        internal static Map <K, V> toMap <T, K, V>(Iterable <T> iterable, Function <T, Map__Entry <K, V> > function)
        {
            var dictionary = FromJava.IterableToEnumerable(iterable)
                             .Select(function.apply)
                             .ToDictionary(entry => entry.getKey(), entry => entry.getValue());

            return(ToJava.DictionaryToMap(dictionary));
        }
Example #4
0
        internal static Map <K, V2> eagerMapValues <K, V1, V2>(Map <K, V1> map, Function <V1, V2> function)
        {
            var dictionary = FromJava.MapToDictionary(map)
                             .ToDictionary(
                entry => entry.Key,
                entry => function.apply(entry.Value));

            return(ToJava.DictionaryToMap(dictionary));
        }
Example #5
0
        internal static Map <K2, V> eagerMapKeys <K1, K2, V>(Map <K1, V> map, Function <K1, K2> function)
        {
            var dictionary = FromJava.MapToDictionary(map)
                             .ToDictionary(
                entry => function.apply(entry.Key),
                entry => entry.Value);

            return(ToJava.DictionaryToMap(dictionary));
        }
Example #6
0
        internal static Map <K, java.util.List <T> > toMultiMapWithKey <T, K>(Iterable <T> iterable, Function <T, K> function)
        {
            var dictionary = FromJava.IterableToEnumerable(iterable)
                             .GroupBy(value => function.apply(value))
                             .ToDictionary(
                grouping => grouping.Key,
                grouping => ToJava.ListToList(grouping.ToList()));

            return(ToJava.DictionaryToMap(dictionary));
        }
Example #7
0
        internal static Map <K, java.util.List <V> > toMultiMap <T, K, V>(Iterable <T> iterable, Function <T, Map__Entry <K, V> > function)
        {
            var dictionary = FromJava.IterableToEnumerable(iterable)
                             .Select(element => function.apply(element))
                             .GroupBy(entry => entry.getKey())
                             .ToDictionary(
                grouping => grouping.Key,
                grouping => ToJava.ListToList(grouping.Select(entry => entry.getValue()).ToList()));

            return(ToJava.DictionaryToMap(dictionary));
        }
Example #8
0
 public Mammoth.Couscous.java.util.Map <string, string> convert(Mammoth.Couscous.org.zwobble.mammoth.images.Image image)
 {
     return(ToJava.DictionaryToMap(func(new Image(image))));
 }
Example #9
0
 internal Map <K, V> build()
 {
     return(ToJava.DictionaryToMap(_values));
 }
Example #10
0
 internal static Map <K, V> map <K, V>()
 {
     return(ToJava.DictionaryToMap(new System.Collections.Generic.Dictionary <K, V>()));
 }