org.apache.manifoldcf.core.interfaces
Class CharacterInput

java.lang.Object
  extended by org.apache.manifoldcf.core.interfaces.CharacterInput
Direct Known Subclasses:
TempFileCharacterInput

public abstract class CharacterInput
extends java.lang.Object

This class represents a lightweight length-determined character stream. It is used as a parameter in parameterized queries that use strings. There are no implied semantics in this class around managing the stream itself. These semantics must be handled by a derived class.


Field Summary
static java.lang.String _rcsid
           
protected  long charLength
           
protected  java.lang.String hashValue
           
protected  java.io.Reader stream
           
 
Constructor Summary
CharacterInput()
          Construct from nothing.
 
Method Summary
protected abstract  void calculateHashValue()
          Calculate the datum's hash value
protected abstract  void calculateLength()
          Calculate the datum's length in characters
protected  void closeStream()
          Close any open reader
 void discard()
          Discard this object permanently
 void doneWithStream()
           
 long getCharacterLength()
           
 java.lang.String getHashValue()
           
 java.io.Reader getStream()
           
abstract  java.io.InputStream getUtf8Stream()
          Open a Utf8 stream directly
protected abstract  void openStream()
          Open a reader, for use by a caller, until closeStream is called
abstract  CharacterInput transfer()
          Transfer to a new object; this causes the current object to become "already discarded"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

stream

protected java.io.Reader stream

charLength

protected long charLength

hashValue

protected java.lang.String hashValue
Constructor Detail

CharacterInput

public CharacterInput()
Construct from nothing.

Method Detail

getStream

public java.io.Reader getStream()
                         throws ManifoldCFException
Throws:
ManifoldCFException

doneWithStream

public void doneWithStream()
                    throws ManifoldCFException
Throws:
ManifoldCFException

getCharacterLength

public long getCharacterLength()
                        throws ManifoldCFException
Throws:
ManifoldCFException

getHashValue

public java.lang.String getHashValue()
                              throws ManifoldCFException
Throws:
ManifoldCFException

getUtf8Stream

public abstract java.io.InputStream getUtf8Stream()
                                           throws ManifoldCFException
Open a Utf8 stream directly

Throws:
ManifoldCFException

transfer

public abstract CharacterInput transfer()
Transfer to a new object; this causes the current object to become "already discarded"


discard

public void discard()
             throws ManifoldCFException
Discard this object permanently

Throws:
ManifoldCFException

openStream

protected abstract void openStream()
                            throws ManifoldCFException
Open a reader, for use by a caller, until closeStream is called

Throws:
ManifoldCFException

closeStream

protected void closeStream()
                    throws ManifoldCFException
Close any open reader

Throws:
ManifoldCFException

calculateLength

protected abstract void calculateLength()
                                 throws ManifoldCFException
Calculate the datum's length in characters

Throws:
ManifoldCFException

calculateHashValue

protected abstract void calculateHashValue()
                                    throws ManifoldCFException
Calculate the datum's hash value

Throws:
ManifoldCFException