1 package net.sf.mmapps.commons.bridge;
2
3 import org.mmbase.bridge.*;
4
5 import java.util.*;
6
7
8 /***
9 * Generic Iterator to use with MMbase node lists
10 *
11 * @author Nico Klasens (Finalist IT Group)
12 * @version $Id: GenericNodeIterator.java,v 1.1 2006/04/06 10:00:34 nklasens Exp $
13 */
14 public class GenericNodeIterator implements NodeIterator {
15
16 ListIterator iter;
17
18 /***
19 * @param iter
20 */
21 public GenericNodeIterator(ListIterator iter) {
22 this.iter = iter;
23 }
24
25 /***
26 * @see java.util.Iterator#hasNext()
27 */
28 public boolean hasNext() {
29 return iter.hasNext();
30 }
31
32 /***
33 * @see java.util.Iterator#next()
34 */
35 public Object next() {
36 return iter.next();
37 }
38
39 /***
40 * @see java.util.ListIterator#hasPrevious()
41 */
42 public boolean hasPrevious() {
43 return iter.hasPrevious();
44 }
45
46 /***
47 * @see java.util.ListIterator#previous()
48 */
49 public Object previous() {
50 return iter.previous();
51 }
52
53 /***
54 * @see java.util.ListIterator#nextIndex()
55 */
56 public int nextIndex() {
57 return iter.nextIndex();
58 }
59
60 /***
61 * @see java.util.ListIterator#previousIndex()
62 */
63 public int previousIndex() {
64 return iter.previousIndex();
65 }
66
67 /***
68 * @see java.util.ListIterator#set(java.lang.Object)
69 */
70 public void set(Object o) {
71 iter.set(o);
72 }
73
74 /***
75 * @see java.util.ListIterator#add(java.lang.Object)
76 */
77 public void add(Object o) {
78 iter.add(o);
79 }
80
81 /***
82 * @see java.util.Iterator#remove()
83 */
84 public void remove() {
85 iter.remove();
86 }
87
88 /***
89 * @see org.mmbase.bridge.NodeIterator#nextNode()
90 */
91 public Node nextNode() {
92 return (Node) iter.next();
93 }
94
95 /***
96 * @see org.mmbase.bridge.NodeIterator#previousNode()
97 */
98 public Node previousNode() {
99 return (Node) iter.previous();
100 }
101 }