All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rbmhtechnology.vind.parser.queryparser.SimpleCharStream Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
/* Generated by: ParserGeneratorCC: Do not edit this line. SimpleCharStream.java Version 1.1 */
/* ParserGeneratorCCOptions:SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.rbmhtechnology.vind.parser.queryparser;

/**
 * An implementation of interface CharStream, where the stream is assumed to
 * contain only ASCII characters (without unicode processing).
 */
public
class SimpleCharStream extends AbstractCharStream
{
  private java.io.Reader m_aIS;

  /** Constructor. */
  public SimpleCharStream(final java.io.Reader dstream,
                          final int startline,
                          final int startcolumn, 
                          final int buffersize)
  {
    super (startline, startcolumn, buffersize);
    m_aIS = dstream;
  }

  /** Constructor. */
  public SimpleCharStream(final java.io.Reader dstream,
                          final int startline,
                          final int startcolumn)
  {
    this(dstream, startline, startcolumn, DEFAULT_BUF_SIZE);
  }

  /** Constructor. */
  public SimpleCharStream(final java.io.Reader dstream)
  {
    this(dstream, 1, 1, DEFAULT_BUF_SIZE);
  }

  /** Reinitialise. */
  public void reInit(final java.io.Reader dstream, 
                     final int startline,
                     final int startcolumn, 
                     final int buffersize)
  {
    m_aIS = dstream;
    super.reInit (startline, startcolumn, buffersize);
  }

  /** Reinitialise. */
  public void reInit(final java.io.Reader dstream, 
                     final int startline,
                     final int startcolumn)
  {
    reInit(dstream, startline, startcolumn, DEFAULT_BUF_SIZE);
  }

  /** Reinitialise. */
  public void reInit(final java.io.Reader dstream)
  {
    reInit(dstream, 1, 1, DEFAULT_BUF_SIZE);
  }
  
  /** Constructor. */
  public SimpleCharStream(final java.io.InputStream dstream, 
                          final java.nio.charset.Charset encoding, 
                          final int startline,
                          final int startcolumn,
                          final int buffersize) 
  {
    this(new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
  }

  /** Constructor. */
  public SimpleCharStream(final java.io.InputStream dstream,
                          final java.nio.charset.Charset encoding, 
                          final int startline,
                          final int startcolumn)
  {
    this(dstream, encoding, startline, startcolumn, DEFAULT_BUF_SIZE);
  }

  /** Constructor. */
  public SimpleCharStream(final java.io.InputStream dstream, 
                          final java.nio.charset.Charset encoding)
  {
    this(dstream, encoding, 1, 1, DEFAULT_BUF_SIZE);
  }

  /** Reinitialise. */
  public void reInit(final java.io.InputStream dstream, 
                     final java.nio.charset.Charset encoding)
  {
    reInit(dstream, encoding, 1, 1, DEFAULT_BUF_SIZE);
  }

  /** Reinitialise. */
  public void reInit(final java.io.InputStream dstream, 
                     final java.nio.charset.Charset encoding, 
                     final int startline,
                     final int startcolumn)
  {
    reInit(dstream, encoding, startline, startcolumn, DEFAULT_BUF_SIZE);
  }

  /** Reinitialise. */
  public void reInit(final java.io.InputStream dstream, 
                     final java.nio.charset.Charset encoding, 
                     final int startline,
                     final int startcolumn, 
                     final int buffersize)
  {
    reInit(new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
  }

  @Override
  protected int streamRead (final char[] aBuf, final int nOfs, final int nLen) throws java.io.IOException
  {
    return m_aIS.read (aBuf, nOfs, nLen); 
  }
  
  @Override
  protected void streamClose () throws java.io.IOException
  {
    if (m_aIS != null)
      m_aIS.close (); 
  }
}
/* ParserGeneratorCC - OriginalChecksum=02999d9c0812703ee19d71e389a1834b (do not edit this line) */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy