All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.iodesystems.fn.data.Indexer Maven / Gradle / Ivy

Go to download

Fn is a lazy Java Library that helps utilize some rudimentary functional concepts with more nounular objects

There is a newer version: 3.0.4
Show newest version
package com.iodesystems.fn.data;

import java.util.HashMap;
import java.util.Map;

public abstract class Indexer implements From {

    public static  Map index(Iterable source, From extractor) {
        Map index = new HashMap<>();
        if (source != null) {
            for (V v : source) {
                index.put(extractor.from(v), v);
            }
        }
        return index;
    }

    public Map index(Iterable source) {
        return index(source, this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy