@Test public final void testContextsTwo() { String ONE = "http: String TWO = "_:two"; ValueFactory f = repo.getValueFactory(); Resource[] check = new Resource[] { f.createIRI(ONE), f.createBNode(TWO.substring(2)) }; String[] tokens = { "command", ONE, TWO }; Resource[] ctxs = Util.getContexts(tokens, 1, repo); assertTrue("Not equal", Arrays.equals(check, ctxs)); }
public static Resource[] getContexts(String[] tokens, int pos, Repository repository) throws IllegalArgumentException { Resource[] contexts = new Resource[] {}; if (tokens.length > pos) { contexts = new Resource[tokens.length - pos]; for (int i = pos; i < tokens.length; i++) { contexts[i - pos] = getContext(repository, tokens[i]); } } return contexts; }
Util { public static Resource[] getContexts(String[] tokens, int pos, Repository repository) throws IllegalArgumentException { Resource[] contexts = new Resource[] {}; if (tokens.length > pos) { contexts = new Resource[tokens.length - pos]; for (int i = pos; i < tokens.length; i++) { contexts[i - pos] = getContext(repository, tokens[i]); } } return contexts; } }
Util { public static Resource[] getContexts(String[] tokens, int pos, Repository repository) throws IllegalArgumentException { Resource[] contexts = new Resource[] {}; if (tokens.length > pos) { contexts = new Resource[tokens.length - pos]; for (int i = pos; i < tokens.length; i++) { contexts[i - pos] = getContext(repository, tokens[i]); } } return contexts; }  }
Util { public static Resource[] getContexts(String[] tokens, int pos, Repository repository) throws IllegalArgumentException { Resource[] contexts = new Resource[] {}; if (tokens.length > pos) { contexts = new Resource[tokens.length - pos]; for (int i = pos; i < tokens.length; i++) { contexts[i - pos] = getContext(repository, tokens[i]); } } return contexts; }  static Resource getContext(Repository repository, String ctxID); static Resource[] getContexts(String[] tokens, int pos, Repository repository); static Path getPath(String file); static String getPrefixedValue(Value value, Map<String, String> namespaces); @Deprecated static String formatToWidth(int width, String padding, String str, String separator); }
Util { public static Resource[] getContexts(String[] tokens, int pos, Repository repository) throws IllegalArgumentException { Resource[] contexts = new Resource[] {}; if (tokens.length > pos) { contexts = new Resource[tokens.length - pos]; for (int i = pos; i < tokens.length; i++) { contexts[i - pos] = getContext(repository, tokens[i]); } } return contexts; }  static Resource getContext(Repository repository, String ctxID); static Resource[] getContexts(String[] tokens, int pos, Repository repository); static Path getPath(String file); static String getPrefixedValue(Value value, Map<String, String> namespaces); @Deprecated static String formatToWidth(int width, String padding, String str, String separator);  }