本文整理汇总了Java中org.apache.hadoop.examples.pi.Container.getElement方法的典型用法代码示例。如果您正苦于以下问题:Java Container.getElement方法的具体用法?Java Container.getElement怎么用?Java Container.getElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.examples.pi.Container
的用法示例。
在下文中一共展示了Container.getElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remainingTerms
import org.apache.hadoop.examples.pi.Container; //导入方法依赖的package包/类
/** Find the remaining terms. */
public <T extends Container<Summation>> List<Summation> remainingTerms(List<T> sorted) {
final List<Summation> results = new ArrayList<Summation>();
Summation remaining = this;
if (sorted != null)
for(Container<Summation> c : sorted) {
final Summation sigma = c.getElement();
if (!remaining.contains(sigma))
throw new IllegalArgumentException("!remaining.contains(s),"
+ "\n remaining = " + remaining
+ "\n s = " + sigma
+ "\n this = " + this
+ "\n sorted = " + sorted);
final Summation s = new Summation(sigma.N.limit, N.delta, remaining.N.limit,
sigma.E.limit, E.delta, remaining.E.limit);
if (s.getSteps() > 0)
results.add(s);
remaining = new Summation(remaining.N.value, N.delta, sigma.N.value,
remaining.E.value, E.delta, sigma.E.value);
}
if (remaining.getSteps() > 0)
results.add(remaining);
return results;
}