public final class Util extends Object
Modifier and Type | Method and Description |
---|---|
static int |
compare(int[] a,
int[] b)
Compares two array lexicographically.
|
static String |
getCatalogFromSpec(String repoAndCatalog)
Parses a store spec of the form [CATALOG:]REPO and returns
the CATALOG.
|
static String |
getRepoFromSpec(String repoAndCatalog)
Parses a store spec of the form [CATALOG:]REPO and returns
the REPO part.
|
static <T> Iterable<T> |
iter(Iteration<T,? extends RuntimeException> i)
Converts an RDF4J iteration object into a Java iterable.
|
static int |
mismatch(int[] a,
int[] b)
Computes the first index where two arrays differ.
|
public static <T> Iterable<T> iter(Iteration<T,? extends RuntimeException> i)
Note that the 'iterable' can be iterated over only once. The purpose of this method is to enable RDF4J iterable objects to be used in for-each loops:
try (TupleQueryResult result = ...) {
for (BindingSet set : Util.iter(result)) { ... }
}
T
- Type of objects returned from the iteration.i
- RDF4J iterable object.public static String getCatalogFromSpec(String repoAndCatalog)
null
if there is no CATALOG.repoAndCatalog
- Store specification ([CATALOG:]REPO).null
.public static String getRepoFromSpec(String repoAndCatalog)
repoAndCatalog
- Store specification ([CATALOG:]REPO).public static int mismatch(int[] a, int[] b)
a
- First array.b
- Second array.NullPointerException
- If either array is null.public static int compare(int[] a, int[] b)
a
- First array.b
- Second array.Comparable.compareTo(Object)
.NullPointerException
- If either array is null.Copyright © 2020 Franz Inc.. All rights reserved.