01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12:
13: package org.tmatesoft.svn.core.internal.wc;
14:
15: import java.util.List;
16:
17: import de.regnis.q.sequence.QSequenceDifferenceBlock;
18:
19: /**
20: * @version 1.1.0
21: * @author TMate Software Ltd.
22: */
23: final class FSMergerBySequenceList {
24:
25: // Fields =================================================================
26:
27: private final List myBlocks;
28:
29: private int myPosition;
30:
31: // Setup ==================================================================
32:
33: public FSMergerBySequenceList(List blocks) {
34: this .myBlocks = blocks;
35: this .myPosition = 0;
36: }
37:
38: // Accessing ==============================================================
39:
40: public boolean hasCurrent() {
41: return myPosition < myBlocks.size();
42: }
43:
44: public QSequenceDifferenceBlock current() {
45: return (QSequenceDifferenceBlock) myBlocks.get(myPosition);
46: }
47:
48: public boolean hasNext() {
49: return myPosition + 1 < myBlocks.size();
50: }
51:
52: public QSequenceDifferenceBlock peekNext() {
53: return myPosition + 1 < myBlocks.size() ? (QSequenceDifferenceBlock) myBlocks
54: .get(myPosition + 1)
55: : null;
56: }
57:
58: public void forward() {
59: myPosition++;
60: }
61: }
|