001package org.biopax.paxtools.pattern.miner;
002
003import org.biopax.paxtools.model.BioPAXElement;
004import org.biopax.paxtools.pattern.Match;
005import org.biopax.paxtools.pattern.Pattern;
006
007import java.io.IOException;
008import java.io.OutputStream;
009import java.util.List;
010import java.util.Map;
011
012/**
013 * A miner provides a pattern to mine, and knows how to use the result set to prepare the text
014 * output.
015 *
016 * @author Ozgun Babur
017 */
018public interface Miner
019{
020        /**
021         * Gets name of the miner.
022         * @return name
023         */
024        public String getName();
025
026        /**
027         * Gets description of the miner.
028         * @return description
029         */
030        public String getDescription();
031
032        /**
033         * Gets the pattern to use for mining the graph.
034         * @return the pattern
035         */
036        public Pattern getPattern();
037
038        /**
039         * Writes the text output to the given stream.
040         * @param matches pattern search result
041         * @param out output stream
042         * @throws IOException when there's a problem writing to the output stream
043         */
044        public void writeResult(Map<BioPAXElement, List<Match>> matches, OutputStream out) throws IOException;
045}