com.ibm.dtfj.analyzer.util
Class DTFJIterator

java.lang.Object
  extended by com.ibm.dtfj.analyzer.util.DTFJIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
DTFJSortedIterator

public class DTFJIterator
extends java.lang.Object
implements java.util.Iterator

This class is intended to simplify the handling of the Iterators returned by the various DTFJ interfaces. Since they can at any point return an instance of CorruptData we need to handle that case and avoid returning those corrupt objects back to the invoking code.


Field Summary
protected  IAnalyzerContext context
           
static int DEFAULT_LIMIT
          Define the maximum number of corrupt data objects or nulls we will handle from a given iterator.
protected  java.util.Iterator rawIterator
           
 
Constructor Summary
DTFJIterator(java.util.Iterator it)
          A 'safe' iterator which has the same semantics as the underlying iterator but handles CorruptData objects and nulls differently.
DTFJIterator(java.util.Iterator it, IAnalyzerContext ctx)
          A 'safe' iterator which has the same semantics as the underlying iterator but handles CorruptData objects and nulls differently.
 
Method Summary
 int getCorruptObjectCount()
          Count the total number of CorruptData objects that have been seen so far.
 int getNullCount()
          Count the total number of nulls that have been seen so far.
protected  boolean handleMoreCorruptObjects(java.lang.Object obj)
           
protected  boolean handleMoreNulls(java.lang.Object obj)
           
 boolean hasNext()
          (non-Javadoc)
 java.lang.Object next()
          (non-Javadoc)
 void remove()
          (non-Javadoc)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LIMIT

public static final int DEFAULT_LIMIT
Define the maximum number of corrupt data objects or nulls we will handle from a given iterator.

See Also:
Constant Field Values

rawIterator

protected java.util.Iterator rawIterator

context

protected IAnalyzerContext context
Constructor Detail

DTFJIterator

public DTFJIterator(java.util.Iterator it,
                    IAnalyzerContext ctx)
A 'safe' iterator which has the same semantics as the underlying iterator but handles CorruptData objects and nulls differently. At present it is designed to simply count the CorruptData and nulls separately and not return them but we could extend it to various forms of logging etc in the future.

Parameters:
it - the iterator that we are going to wrap
ctx - the current analyzer context

DTFJIterator

public DTFJIterator(java.util.Iterator it)
A 'safe' iterator which has the same semantics as the underlying iterator but handles CorruptData objects and nulls differently. At present it is designed to simply count the CorruptData and nulls separately and not return them but we could extend it to various forms of logging etc in the future.

Parameters:
it - the iterator that we are going to wrap
Method Detail

hasNext

public boolean hasNext()
(non-Javadoc)

Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
(non-Javadoc)

Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

remove

public void remove()
(non-Javadoc)

Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()

getCorruptObjectCount

public int getCorruptObjectCount()
Count the total number of CorruptData objects that have been seen so far.

Returns:
total CorruptData objects.

getNullCount

public int getNullCount()
Count the total number of nulls that have been seen so far.

Returns:
total nulls.

handleMoreCorruptObjects

protected boolean handleMoreCorruptObjects(java.lang.Object obj)

handleMoreNulls

protected boolean handleMoreNulls(java.lang.Object obj)


© Copyright IBM Corp. 2007, 2008 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.