GXPARSE hosted by SourceForge.net Logo

ca.gorman.util.scan
Class InputControl.Default

java.lang.Object
  extended by ca.gorman.util.scan.InputControl.Default
All Implemented Interfaces:
Expandable, InputControl
Enclosing interface:
InputControl

public static class InputControl.Default
extends Object
implements InputControl

An implementation of InputControl with methods that do nothing.


Nested Class Summary
 
Nested classes/interfaces inherited from interface ca.gorman.util.scan.InputControl
InputControl.Default
 
Constructor Summary
InputControl.Default()
           
 
Method Summary
 int discard(int n)
           Discard a leading prefix of characters from the buffer.
 boolean expand()
           Increase the amount of data in the buffer, if the buffer supports expansion.
 int fill()
           Make more characters available in a buffer with free space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputControl.Default

public InputControl.Default()
Method Detail

expand

public boolean expand()
               throws IOException
Description copied from interface: Expandable

Increase the amount of data in the buffer, if the buffer supports expansion.

Expansion is not guaranteed, because the buffer may not support expansion or because the current state of the buffer (or its data source) may not permit expansion.

A successful expansion of a full buffer will increase the memory used by the buffer. A buffer with free space may simply add more data to the free space instead of acquiring and filling additional memory.

Specified by:
expand in interface Expandable
Returns:
true if more data has been made available in the buffer
Throws:
IOException

fill

public int fill()
         throws IOException
Description copied from interface: InputControl

Make more characters available in a buffer with free space.

Specified by:
fill in interface InputControl
Returns:
the number (possibly zero) of additional characters made available, or a negative number to indicate that additional chaacters will never be available.
Throws:
IOException

discard

public int discard(int n)
Description copied from interface: InputControl

Discard a leading prefix of characters from the buffer.

Specified by:
discard in interface InputControl
Parameters:
n - The number of characters to be discarded
Returns:
The number (from zero to the number requested) of characters discarded

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License