01: /*
02: * Created on Sep 23, 2004
03: */
04: package uk.org.ponder.saxalizer;
05:
06: import java.util.ArrayList;
07:
08: /**
09: * A typesafe wrapper for a list of SAXAccessMethodSpec objects
10: * @author Antranig Basman (antranig@caret.cam.ac.uk)
11: *
12: */
13: public class SAMSList extends ArrayList {
14: public SAXAccessMethodSpec SAMSAt(int i) {
15: return (SAXAccessMethodSpec) get(i);
16: }
17:
18: /** Returns the first SAXAccessMethodSpec object that matches the
19: * given XML name, or <code>null</code> if none is found. There
20: * should be at most one such entry at any time.
21: * @param tagname
22: * @return
23: */
24: public SAXAccessMethodSpec byXMLName(String tagname) {
25: for (int i = 0; i < size(); ++i) {
26: SAXAccessMethodSpec thissams = SAMSAt(i);
27: if (thissams.xmlname.equals(tagname))
28: return thissams;
29: }
30: return null;
31: }
32: }
|