01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10:
11: package org.mmbase.bridge.implementation;
12:
13: import java.util.Collection;
14:
15: import org.mmbase.bridge.*;
16:
17: /**
18: * A list of relations
19: *
20: * @author Pierre van Rooden
21: * @version $Id: BasicRelationList.java,v 1.22 2007/02/10 15:47:42 nklasens Exp $
22: */
23: public class BasicRelationList extends AbstractNodeList<Relation>
24: implements RelationList {
25:
26: BasicRelationList() {
27: super ();
28: }
29:
30: BasicRelationList(Collection c, Cloud cloud) {
31: super (c, cloud);
32: }
33:
34: BasicRelationList(Collection c, NodeManager nodemanager) {
35: super (c, nodemanager);
36: }
37:
38: public Relation getRelation(int index) {
39: return get(index);
40: }
41:
42: public RelationList subRelationList(int fromIndex, int toIndex) {
43: if (nodeManager != null) {
44: return new BasicRelationList(subList(fromIndex, toIndex),
45: nodeManager);
46: } else {
47: return new BasicRelationList(subList(fromIndex, toIndex),
48: cloud);
49: }
50: }
51:
52: public RelationIterator relationIterator() {
53: return new BasicRelationIterator();
54: }
55:
56: protected class BasicRelationIterator extends BasicIterator
57: implements RelationIterator {
58:
59: public Relation nextRelation() {
60: return next();
61: }
62:
63: public Relation previousRelation() {
64: return previous();
65: }
66: }
67: }
|