本文整理匯總了Java中java.util.NoSuchElementException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java NoSuchElementException.printStackTrace方法的具體用法?Java NoSuchElementException.printStackTrace怎麽用?Java NoSuchElementException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.NoSuchElementException
的用法示例。
在下文中一共展示了NoSuchElementException.printStackTrace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: runPendingOnDrawTasks
import java.util.NoSuchElementException; //導入方法依賴的package包/類
protected void runPendingOnDrawTasks() {
try {
while (!mRunOnDraw.isEmpty()) {
mRunOnDraw.removeFirst().run();
}
} catch (NoSuchElementException e) {
e.printStackTrace();
}
}
示例2: run
import java.util.NoSuchElementException; //導入方法依賴的package包/類
private void run(int q, double alpha, int iter)
throws ParseException, TransactionAbortedException, DbException, IOException, ParsingException {
String query = queries[q] + ";";
// time planning
Instant planStart = Instant.now();
DbIterator imputed = planQuery(query, x -> new ImputedLogicalPlan(alpha, this.imputeAtBase));
Instant planEnd = Instant.now();
// time running
StringBuilder results = new StringBuilder();
Instant runStart = Instant.now();
// some queries we only want to time the planning phase
if (!planOnly) {
imputed.open();
while (imputed.hasNext()) {
try {
results.append(imputed.next().toString());
results.append("\n");
} catch (NoSuchElementException e) {
e.printStackTrace();
}
}
}
Instant runEnd = Instant.now();
// get plan run
QueryPlanVisualizer viz = new QueryPlanVisualizer();
String plan = viz.getQueryPlanTree(imputed);
// Write results
writeTime(q, alpha, iter, Duration.between(planStart, planEnd).toMillis(),
Duration.between(runStart, runEnd).toMillis(), plan.hashCode());
writeResult(q, alpha, iter, results.toString());
writePlan(q, alpha, iter, plan);
}
示例3: drain
import java.util.NoSuchElementException; //導入方法依賴的package包/類
private static void drain(DbIterator iter) throws DbException, TransactionAbortedException {
while (iter.hasNext()) {
try {
iter.next();
} catch(NoSuchElementException e) {
e.printStackTrace();
}
}
}