KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > textmining > text > extraction > sprm > SprmIterator


1 /* Copyright 2004 Ryan Ackley
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */

15
16 package org.textmining.text.extraction.sprm;
17
18 /**
19  * This class is used to iterate through a list of sprms from a Word 97/2000/XP
20  * document.
21  * @author Ryan Ackley
22  * @version 1.0
23  */

24
25 public class SprmIterator
26 {
27   private byte[] _grpprl;
28   int _offset;
29
30   public SprmIterator(byte[] grpprl)
31   {
32     _grpprl = grpprl;
33     _offset = 0;
34   }
35
36   public boolean hasNext()
37   {
38     return _offset < _grpprl.length;
39   }
40
41   public SprmOperation next()
42   {
43     SprmOperation op = new SprmOperation(_grpprl, _offset);
44     _offset += op.size();
45     return op;
46   }
47
48
49 }
50
Popular Tags