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

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

Introduction

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

Prototype

public double value() throws ConcurrentModificationException, NoSuchElementException 

Source Link

Document

Get the value of this.current entry.

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();//ww  w.j a v  a 2  s. c o m
            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();/*  w w  w.  j  a va  2  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();
}