org.perf4j.helpers
Class StopWatchLogIterator

java.lang.Object
  extended by org.perf4j.helpers.StopWatchLogIterator
All Implemented Interfaces:
Iterator<StopWatch>

public class StopWatchLogIterator
extends Object
implements Iterator<StopWatch>

The StopWatchLogIterator class takes input from a Reader and parses it so that deserialized StopWatch instances can be returned with each call to next(). Log messages that are not recognized as StopWatch calls are just ignored.

Author:
Alex Devine

Constructor Summary
StopWatchLogIterator(Readable log)
          Creates a new StopWatchLogIterator to parse input from the specified Readable instance.
 
Method Summary
 boolean hasNext()
           
protected  StopWatchParser newStopWatchParser()
          This helper method could potentially be overridden to return a different type of StopWatchParser that is used to parse the strings read by this class.
 StopWatch next()
           
 void remove()
          Remove is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWatchLogIterator

public StopWatchLogIterator(Readable log)
Creates a new StopWatchLogIterator to parse input from the specified Readable instance.

Parameters:
log - The log containing the data to be parsed.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<StopWatch>

next

public StopWatch next()
Specified by:
next in interface Iterator<StopWatch>

remove

public void remove()
Remove is not supported.

Specified by:
remove in interface Iterator<StopWatch>
Throws:
UnsupportedOperationException - Always thrown.

newStopWatchParser

protected StopWatchParser newStopWatchParser()
This helper method could potentially be overridden to return a different type of StopWatchParser that is used to parse the strings read by this class.

Returns:
A new StopWatchParser to use to parse log messages.


Copyright © 2008-2009 perf4j.org. All Rights Reserved.