Example usage for org.apache.commons.collections15.buffer PriorityBuffer iterator

List of usage examples for org.apache.commons.collections15.buffer PriorityBuffer iterator

Introduction

In this page you can find the example usage for org.apache.commons.collections15.buffer PriorityBuffer iterator.

Prototype

public Iterator<E> iterator() 

Source Link

Document

Returns an iterator over this heap's elements.

Usage

From source file:edu.cuny.cat.market.FourHeapTest.java

public static int countQty(final PriorityBuffer<Shout> heap) {
    final Iterator<Shout> i = heap.iterator();
    int qty = 0;/* w w w. j  av a  2 s .com*/
    while (i.hasNext()) {
        final Shout s = i.next();
        qty += s.getQuantity();
    }
    return qty;
}

From source file:edu.cuny.cat.market.matching.FourHeapShoutEngine.java

public void prettyPrint(final String title, final PriorityBuffer<Shout> shouts) {
    FourHeapShoutEngine.logger.info(title);
    FourHeapShoutEngine.logger.info("--------------");
    final Iterator<Shout> i = shouts.iterator();
    while (i.hasNext()) {
        final Shout shout = i.next();
        FourHeapShoutEngine.logger.info(shout.toPrettyString());
    }//w ww .  ja v a  2 s . c  o m
    FourHeapShoutEngine.logger.info("");
}