1 27 package org.htmlparser.tags; 28 29 import java.util.Locale ; 30 31 import org.htmlparser.Node; 32 import org.htmlparser.util.NodeList; 33 import org.htmlparser.util.SimpleNodeIterator; 34 35 38 public class FrameSetTag extends CompositeTag 39 { 40 43 private static final String [] mIds = new String [] {"FRAMESET"}; 44 45 48 private static final String [] mEndTagEnders = new String [] {"HTML"}; 49 50 53 public FrameSetTag () 54 { 55 } 56 57 61 public String [] getIds () 62 { 63 return (mIds); 64 } 65 66 70 public String [] getEndTagEnders () 71 { 72 return (mEndTagEnders); 73 } 74 75 78 public String toString() 79 { 80 return "FRAMESET TAG : begins at : "+getStartPosition ()+"; ends at : "+getEndPosition (); 81 } 82 83 87 public NodeList getFrames() 88 { 89 return (getChildren()); 90 } 91 92 99 public FrameTag getFrame (String name) 100 { 101 return (getFrame (name, Locale.ENGLISH)); 102 } 103 104 112 public FrameTag getFrame (String name, Locale locale) 113 { 114 Node node; 115 FrameTag ret; 116 117 ret = null; 118 119 name = name.toUpperCase (locale); 120 for (SimpleNodeIterator e = getFrames ().elements (); e.hasMoreNodes () && (null == ret); ) 121 { 122 node = e.nextNode(); 123 if (node instanceof FrameTag) 124 { 125 ret = (FrameTag)node; 126 if (!ret.getFrameName ().toUpperCase (locale).equals (name)) 127 ret = null; 128 } 129 } 130 131 return (ret); 132 } 133 134 138 public void setFrames(NodeList frames) 139 { 140 setChildren (frames); 141 } 142 } 143 | Popular Tags |