1 10 11 package org.mmbase.bridge.implementation; 12 13 import java.util.Collection ; 14 import org.mmbase.bridge.*; 15 import org.mmbase.core.CoreField; 16 17 23 public class BasicFieldList extends BasicList implements FieldList { 24 25 NodeManager nodemanager=null; 26 27 BasicFieldList() { 28 super(); 29 } 30 31 public BasicFieldList(Collection c, NodeManager nodemanager) { 32 super(c); 33 this.nodemanager = nodemanager; 34 } 35 36 public Object convert(Object o, int index) { 37 if (o instanceof BasicField) { 38 return o; 39 } else if (o instanceof Field) { 40 Field f = new BasicField((Field)o, nodemanager); 42 set(index, f); 43 return f; 44 } else { return o; 48 } 49 } 50 51 protected Object validate(Object o) throws ClassCastException { 52 if (o instanceof CoreField) { 53 return o; 54 } else { 55 return (Field)o; 56 } 57 } 58 59 public Field getField(int index) { 60 return (Field)get(index); 61 } 62 63 public FieldIterator fieldIterator() { 64 return new BasicFieldIterator(); 65 } 66 67 protected class BasicFieldIterator extends BasicIterator implements FieldIterator { 68 69 public Field nextField() { 70 return (Field) next(); 71 } 72 73 public Field previousField() { 74 return (Field) previous(); 75 } 76 77 } 78 } 79 | Popular Tags |