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: import org.mmbase.bridge.*;
15: import org.mmbase.util.logging.*;
16:
17: /**
18: * A list of node managers
19: *
20: * @author Pierre van Rooden
21: * @version $Id: BasicNodeManagerList.java,v 1.17 2007/02/23 16:26:48 michiel Exp $
22: */
23: public class BasicNodeManagerList extends AbstractNodeList<NodeManager>
24: implements NodeManagerList {
25:
26: private static final Logger log = Logging
27: .getLoggerInstance(BasicNodeManagerList.class);
28:
29: BasicNodeManagerList() {
30: super ();
31: }
32:
33: BasicNodeManagerList(Collection c, Cloud cloud) {
34: super (c, cloud);
35: }
36:
37: protected NodeManager convert(Object o) {
38: if (o == null)
39: return null;
40: if (o instanceof CharSequence) {
41: return cloud.getNodeManager(o.toString());
42: }
43: return super .convert(o).toNodeManager();
44: }
45:
46: public NodeManager getNodeManager(int index) {
47: return get(index);
48: }
49:
50: public NodeManagerIterator nodeManagerIterator() {
51: return new BasicNodeManagerIterator();
52: };
53:
54: public NodeManagerList subNodeManagerList(int fromIndex, int toIndex) {
55: return new BasicNodeManagerList(subList(fromIndex, toIndex),
56: cloud);
57: }
58:
59: protected class BasicNodeManagerIterator extends BasicIterator
60: implements NodeManagerIterator {
61:
62: public NodeManager nextNodeManager() {
63: return next();
64: }
65:
66: public NodeManager previousNodeManager() {
67: return previous();
68: }
69: }
70:
71: }
|