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

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

Introduction

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

Prototype

public boolean hasNext() 

Source Link

Document

Check if there is a this.next element in the map.

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();//from w w w. j a  v  a 2 s.  com
            this.point.setEntry(iter.key(), iter.value());
        }
    }
    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();//from  w ww  .  j  av a2 s  . c  om
        if (iter.value() > 0) {
            BytesRef b = new BytesRef();
            hash.get(iter.key(), b);
            System.out.print(b.utf8ToString() + ":" + iter.value() + "  ");
        }
    }
    System.out.println();
}