本文整理汇总了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();
}
}
}