|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hypergraphdb.util.HGUtils
public class HGUtils
The mandatory bag of static utility method class.
| Constructor Summary | |
|---|---|
HGUtils()
|
|
| Method Summary | ||
|---|---|---|
static void |
closeNoException(HGSearchResult<?> rs)
|
|
static boolean |
eq(byte[] left,
byte[] right)
|
|
static boolean |
eq(java.lang.Object[] left,
java.lang.Object[] right)
Compare two arrays for equality. |
|
static boolean |
eq(java.lang.Object left,
java.lang.Object right)
Compare two objects for equality, checking for null values as well. |
|
static java.lang.Throwable |
getRootCause(java.lang.Throwable t)
|
|
static int |
hashIt(java.lang.Object o)
Return an object's hash code or 0 if the object is null. |
|
static int |
hashThem(java.lang.Object one,
java.lang.Object two)
Return a composite hash code of two objects. |
|
static boolean |
isEmpty(java.lang.String s)
|
|
static
|
loadClass(java.lang.String classname)
|
|
static void |
logCallStack(java.io.PrintStream out)
|
|
static void |
printStackTrace(java.lang.StackTraceElement[] trace,
java.io.PrintStream out)
|
|
static java.lang.String |
printStackTrace(java.lang.Throwable t)
Print the full stack trace of a Throwable object into a
string buffer and return the corresponding string. |
|
static
|
queryBatchProcess(HGQuery<T> query,
Mapping<T,java.lang.Boolean> F,
int batchSize,
T startAfter,
long first)
Process a potentially large query result in batches where each batch is a encapsulated in a single transaction. |
|
static java.lang.RuntimeException |
throwRuntimeException(java.lang.Throwable t)
|
|
static HGHandle[] |
toHandleArray(HGLink link)
|
|
static void |
wrapAndRethrow(java.lang.Throwable t)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HGUtils()
| Method Detail |
|---|
public static boolean isEmpty(java.lang.String s)
public static java.lang.RuntimeException throwRuntimeException(java.lang.Throwable t)
public static java.lang.Throwable getRootCause(java.lang.Throwable t)
public static boolean eq(java.lang.Object left,
java.lang.Object right)
Compare two objects for equality, checking for null values as well.
public static boolean eq(java.lang.Object[] left,
java.lang.Object[] right)
Compare two arrays for equality. This will perform a deep comparison, return
true if and only if all elements of the passed in arrays are equal.
public static boolean eq(byte[] left,
byte[] right)
public static int hashIt(java.lang.Object o)
Return an object's hash code or 0 if the object is null.
public static int hashThem(java.lang.Object one,
java.lang.Object two)
Return a composite hash code of two objects.
public static java.lang.String printStackTrace(java.lang.Throwable t)
Print the full stack trace of a Throwable object into a
string buffer and return the corresponding string.
public static void printStackTrace(java.lang.StackTraceElement[] trace,
java.io.PrintStream out)
public static void logCallStack(java.io.PrintStream out)
public static void closeNoException(HGSearchResult<?> rs)
public static void wrapAndRethrow(java.lang.Throwable t)
public static <T> java.lang.Class<T> loadClass(java.lang.String classname)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic static HGHandle[] toHandleArray(HGLink link)
public static <T> long queryBatchProcess(HGQuery<T> query,
Mapping<T,java.lang.Boolean> F,
int batchSize,
T startAfter,
long first)
Process a potentially large query result in batches where each batch is a encapsulated
in a single transaction. It is assumed that the result of the query
is a HGRandomAccessResult so it is possible to quickly position at
the beginning of the next batch.
The startAfter and first parameters define a starting point
for the process. Use either one of them, but not both.
T - query - The query that produces the result set to be scanned.F - The function to perform on that query. The function takes a query result item
and return a boolean which indicates whether to continue processing (if true)
or stop (if false).batchSize - The number of result items to encapsulate in a single transaction.startAfter - Start processing at the first element after this parameter.first - A 1-based index of the first element to process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||