Clover Coverage Report
Coverage timestamp: Fri May 9 2008 10:54:27 EST
../../../../../img/srcFileCovDistChart0.png 86% of files have more coverage
160   401   59   5.71
48   322   0.37   28
28     2.11  
1    
 
  SimpleCharStream       Line # 9 160 59 0% 0.0
 
No Tests
 
1    /* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 3.0 */
2    package org.apache.lucene.demo.html;
3   
4    /**
5    * An implementation of interface CharStream, where the stream is assumed to
6    * contain only ASCII characters (without unicode processing).
7    */
8   
 
9    public class SimpleCharStream
10    {
11    public static final boolean staticFlag = false;
12    int bufsize;
13    int available;
14    int tokenBegin;
15    public int bufpos = -1;
16    protected int bufline[];
17    protected int bufcolumn[];
18   
19    protected int column = 0;
20    protected int line = 1;
21   
22    protected boolean prevCharIsCR = false;
23    protected boolean prevCharIsLF = false;
24   
25    protected java.io.Reader inputStream;
26   
27    protected char[] buffer;
28    protected int maxNextCharInd = 0;
29    protected int inBuf = 0;
30   
 
31  0 toggle protected void ExpandBuff(boolean wrapAround)
32    {
33  0 char[] newbuffer = new char[bufsize + 2048];
34  0 int newbufline[] = new int[bufsize + 2048];
35  0 int newbufcolumn[] = new int[bufsize + 2048];
36   
37  0 try
38    {
39  0 if (wrapAround)
40    {
41  0 System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
42  0 System.arraycopy(buffer, 0, newbuffer,
43    bufsize - tokenBegin, bufpos);
44  0 buffer = newbuffer;
45   
46  0 System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
47  0 System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
48  0 bufline = newbufline;
49   
50  0 System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
51  0 System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
52  0 bufcolumn = newbufcolumn;
53   
54  0 maxNextCharInd = (bufpos += (bufsize - tokenBegin));
55    }
56    else
57    {
58  0 System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
59  0 buffer = newbuffer;
60   
61  0 System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
62  0 bufline = newbufline;
63   
64  0 System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
65  0 bufcolumn = newbufcolumn;
66   
67  0 maxNextCharInd = (bufpos -= tokenBegin);
68    }
69    }
70    catch (Throwable t)
71    {
72  0 throw new Error(t.getMessage());
73    }
74   
75   
76  0 bufsize += 2048;
77  0 available = bufsize;
78  0 tokenBegin = 0;
79    }
80   
 
81  0 toggle protected void FillBuff() throws java.io.IOException
82    {
83  0 if (maxNextCharInd == available)
84    {
85  0 if (available == bufsize)
86    {
87  0 if (tokenBegin > 2048)
88    {
89  0 bufpos = maxNextCharInd = 0;
90  0 available = tokenBegin;
91    }
92  0 else if (tokenBegin < 0)
93  0 bufpos = maxNextCharInd = 0;
94    else
95  0 ExpandBuff(false);
96    }
97  0 else if (available > tokenBegin)
98  0 available = bufsize;
99  0 else if ((tokenBegin - available) < 2048)
100  0 ExpandBuff(true);
101    else
102  0 available = tokenBegin;
103    }
104   
105  0 int i;
106  0 try {
107  0 if ((i = inputStream.read(buffer, maxNextCharInd,
108    available - maxNextCharInd)) == -1)
109    {
110  0 inputStream.close();
111  0 throw new java.io.IOException();
112    }
113    else
114  0 maxNextCharInd += i;
115  0 return;
116    }
117    catch(java.io.IOException e) {
118  0 --bufpos;
119  0 backup(0);
120  0 if (tokenBegin == -1)
121  0 tokenBegin = bufpos;
122  0 throw e;
123    }
124    }
125   
 
126  0 toggle public char BeginToken() throws java.io.IOException
127    {
128  0 tokenBegin = -1;
129  0 char c = readChar();
130  0 tokenBegin = bufpos;
131   
132  0 return c;
133    }
134   
 
135  0 toggle protected void UpdateLineColumn(char c)
136    {
137  0 column++;
138   
139  0 if (prevCharIsLF)
140    {
141  0 prevCharIsLF = false;
142  0 line += (column = 1);
143    }
144  0 else if (prevCharIsCR)
145    {
146  0 prevCharIsCR = false;
147  0 if (c == '\n')
148    {
149  0 prevCharIsLF = true;
150    }
151    else
152  0 line += (column = 1);
153    }
154   
155  0 switch (c)
156