Example usage for org.apache.commons.math3.util Iterator advance

List of usage examples for org.apache.commons.math3.util Iterator advance

Introduction

In this page you can find the example usage for org.apache.commons.math3.util Iterator advance.

Prototype

public void advance() throws ConcurrentModificationException, NoSuchElementException 

Source Link

Document

Advance iterator one step further.

Usage

From source file:org.meresco.lucene.search.MerescoVector.java

public double[] getPoint() {
    if (this.point == null) {
        this.point = new ArrayRealVector(this.maxIndex + 1);
        Iterator iter = entries.iterator();
        while (iter.hasNext()) {
            iter.advance();
            this.point.setEntry(iter.key(), iter.value());
        }//  w ww .  j a v  a2  s  .  c  o  m
    }
    this.point.unitize();
    return this.point.getDataRef();
}

From source file:org.meresco.lucene.search.MerescoVector.java

public void printVector(BytesRefHash hash) {
    Iterator iter = entries.iterator();
    while (iter.hasNext()) {
        iter.advance();
        if (iter.value() > 0) {
            BytesRef b = new BytesRef();
            hash.get(iter.key(), b);//from ww w  .  j  a  v a 2s  . co  m
            System.out.print(b.utf8ToString() + ":" + iter.value() + "  ");
        }
    }
    System.out.println();
}