01: /* Copyright 2004 Ryan Ackley
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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: private byte[] _grpprl;
27: int _offset;
28:
29: public SprmIterator(byte[] grpprl) {
30: _grpprl = grpprl;
31: _offset = 0;
32: }
33:
34: public boolean hasNext() {
35: return _offset < _grpprl.length;
36: }
37:
38: public SprmOperation next() {
39: SprmOperation op = new SprmOperation(_grpprl, _offset);
40: _offset += op.size();
41: return op;
42: }
43:
44: }
|