View Javadoc
1   /* Generated by: ParserGeneratorCC: Do not edit this line. SimpleCharStream.java Version 1.1 */
2   /* ParserGeneratorCCOptions:SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
3   package org.apache.commons.jexl3.parser;
4   
5   /**
6    * An implementation of interface CharStream, where the stream is assumed to
7    * contain only ASCII characters (without unicode processing).
8    */
9   public
10  class SimpleCharStream extends AbstractCharStream
11  {
12    private Provider inputStream;
13  
14    @Override
15    protected int streamRead (final char[] aBuf, final int nOfs, final int nLen) throws java.io.IOException
16    {
17      return inputStream.read (aBuf, nOfs, nLen); 
18    }
19    
20    @Override
21    protected void streamClose() throws java.io.IOException
22    {
23      inputStream.close (); 
24    }
25  
26    /** Constructor. */
27    public SimpleCharStream(final Provider dstream,
28                            final int startline,
29                            final int startcolumn,
30                            final int buffersize)
31    {
32      super (startline, startcolumn, buffersize);
33      inputStream = dstream;
34    }
35  
36    /** Constructor. */
37    public SimpleCharStream(final Provider dstream,
38                            final int startline,
39                            final int startcolumn)
40    {
41      this(dstream, startline, startcolumn, DEFAULT_BUF_SIZE);
42    }
43  
44    /** Constructor. */
45    public SimpleCharStream(final Provider dstream)
46    {
47      this(dstream, 1, 1, DEFAULT_BUF_SIZE);
48    }
49  
50    /** Reinitialise. */
51    public void reInit(final Provider dstream,
52                       final int startline,
53                       final int startcolumn,
54                       final int buffersize)
55    {
56      inputStream = dstream;
57      super.reInit (startline, startcolumn, buffersize);
58    }
59  
60    /** Reinitialise. */
61    public void reInit(final Provider dstream,
62                       final int startline,
63                       final int startcolumn)
64    {
65      reInit(dstream, startline, startcolumn, DEFAULT_BUF_SIZE);
66    }
67  
68    /** Reinitialise. */
69    public void reInit(final Provider dstream)
70    {
71      reInit(dstream, 1, 1, DEFAULT_BUF_SIZE);
72    }
73  }
74  /* ParserGeneratorCC - OriginalChecksum=542026dd48959c684c77c4bfaffe536a (do not edit this line) */