package org.simantics.graph.store; import gnu.trove.set.hash.THashSet; import java.util.regex.Pattern; import org.simantics.graph.query.Path; import org.simantics.graph.query.PathChild; import org.simantics.graph.query.Paths; public class PathPattern { private static PathPattern EMPTY_PATTERN = new PathPattern(null, null); Path prefix; Pattern suffix; private PathPattern(Path prefix, Pattern suffix) { this.prefix = prefix; this.suffix = suffix; } public static PathPattern compile(String pattern) { pattern = stripPatternPrefix(pattern); if(pattern == null) return EMPTY_PATTERN; String[] parts = pattern.split("/"); Path path = Paths.Root; for(int i=0;i result) { int id = store.pathToId(prefix); if(id == -1) return; store.findChildren(id, prefix, "", suffix, result); } public static void main(String[] args) { System.out.println(compile("http://www.simantics.org/*/foo")); } }