Package graphmatcher.matcher

Source Code of graphmatcher.matcher.MatcherFactory

package graphmatcher.matcher;

import graphmatcher.graph.Graph;
import graphmatcher.matcher.komatcher.KOSystemGraphMatcher;
import graphmatcher.matcher.shapecontext.ShapeContextGraphMatcher;
import graphmatcher.matcher.simple.SimpleMatcher;

public class MatcherFactory {

  public static AbstractMatcher createMatcher(String matcherID, Graph pattern, Graph template) {
    if (matcherID.equals(SimpleMatcher.matcherID)) {
      return new SimpleMatcher(pattern, template);
    }
    if (matcherID.equals(ShapeContextGraphMatcher.matcherID)) {
      return new ShapeContextGraphMatcher(pattern, template);
    }
    if (matcherID.equals(KOSystemGraphMatcher.matcherID)) {
      return new KOSystemGraphMatcher(pattern, template);
    }
    throw new IllegalArgumentException("unbekannter MatcherID");
  }
}
TOP

Related Classes of graphmatcher.matcher.MatcherFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.