org.apache.abdera.util.io
Class RestrictedCodepointIterator

java.lang.Object
  extended by org.apache.abdera.util.io.CodepointIterator
      extended by org.apache.abdera.util.io.FilterCodepointIterator
          extended by org.apache.abdera.util.io.RestrictedCodepointIterator

public class RestrictedCodepointIterator
extends FilterCodepointIterator

A CodepointIterator implementation that checks output against a BitSet. If the iterator is set to "scanning only", the iterator will return -1 upon encountering a codepoint not in the set, otherwise the iterator will throw an InvalidCharacterException


Field Summary
 
Fields inherited from class org.apache.abdera.util.io.CodepointIterator
limit, position
 
Constructor Summary
protected RestrictedCodepointIterator(CodepointIterator internal, java.util.BitSet bitset)
           
protected RestrictedCodepointIterator(CodepointIterator internal, java.util.BitSet bitset, boolean scanningOnly)
           
protected RestrictedCodepointIterator(CodepointIterator internal, java.util.BitSet bitset, boolean scanningOnly, boolean notset)
           
 
Method Summary
 boolean hasNext()
           
static void main(java.lang.String... args)
           
 int next()
           
 char[] nextChars()
           
 
Methods inherited from class org.apache.abdera.util.io.FilterCodepointIterator
get, get, isHigh, isLow, limit, peek, peek, peekChars, position, position, remaining
 
Methods inherited from class org.apache.abdera.util.io.CodepointIterator
forByteArray, forCharArray, forCharBuffer, forCharSequence, last, lastPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestrictedCodepointIterator

protected RestrictedCodepointIterator(CodepointIterator internal,
                                      java.util.BitSet bitset)

RestrictedCodepointIterator

protected RestrictedCodepointIterator(CodepointIterator internal,
                                      java.util.BitSet bitset,
                                      boolean scanningOnly)

RestrictedCodepointIterator

protected RestrictedCodepointIterator(CodepointIterator internal,
                                      java.util.BitSet bitset,
                                      boolean scanningOnly,
                                      boolean notset)
Method Detail

hasNext

public boolean hasNext()
Overrides:
hasNext in class FilterCodepointIterator

next

public int next()
         throws InvalidCharacterException
Overrides:
next in class FilterCodepointIterator
Throws:
InvalidCharacterException

nextChars

public char[] nextChars()
                 throws InvalidCharacterException
Overrides:
nextChars in class FilterCodepointIterator
Throws:
InvalidCharacterException

main

public static void main(java.lang.String... args)
                 throws java.lang.Exception
Throws:
java.lang.Exception