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

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

Introduction

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

Prototype

public int key() throws ConcurrentModificationException, NoSuchElementException 

Source Link

Document

Get the key 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();/* w ww . j  ava2  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();//  www  .  java2 s  . c o m
        if (iter.value() > 0) {
            BytesRef b = new BytesRef();
            hash.get(iter.key(), b);
            System.out.print(b.utf8ToString() + ":" + iter.value() + "  ");
        }
    }
    System.out.println();
}