aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/layoutmgr/BreakPossPosIter.java
blob: a868ac5e5531ae779398d206c81184602b101b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * $Id$
 * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
 * For details on use and redistribution please refer to the
 * LICENSE file included with these sources.
 */

package org.apache.fop.layoutmgr;


import java.util.List;

public class BreakPossPosIter extends PositionIterator {
    private int m_iterCount ;

    BreakPossPosIter(List bpList, int startPos, int endPos) {
	super(bpList.listIterator(startPos));
	m_iterCount = endPos - startPos;
    }

    // Check position < endPos

    protected boolean checkNext() {
	if (m_iterCount > 0) {
	    return super.checkNext();
	}
	else {
	    endIter();
	    return false;
	}
    }

    public Object next() {
	--m_iterCount;
	return super.next();
    }

    protected BPLayoutManager getLM(Object nextObj) {
	return ((BreakPoss)nextObj).getLayoutManager();
    }

    protected BreakPoss.Position getPos(Object nextObj) {
	return ((BreakPoss)nextObj).getPosition();
    }

}