Methods Summary |
---|
public void | close()
inrdr.close();
|
public static void | main(java.lang.String[] args)
/* Simple main showing one way of using the ReadTag class. */
if (args.length == 0) {
System.err.println("Usage: ReadTag URL [...]");
return;
}
for (int i=0; i<args.length; i++) {
ReadTag rt = new ReadTag(args[0]);
String tag;
while ((tag = rt.nextTag()) != null) {
System.out.println(tag);
}
rt.close();
}
|
public java.lang.String | nextTag()Read the next tag.
int i;
while ((i = inrdr.read()) != -1) {
char thisChar = (char)i;
if (thisChar == '<") {
String tag = readTag();
return tag;
}
}
return null;
|
protected java.lang.String | readTag()Read one tag. Adapted from code by Elliotte Rusty Harold
StringBuffer theTag = new StringBuffer("<");
int i = '<";
while (i != '>" && (i = inrdr.read()) != -1) {
theTag.append((char)i);
}
return theTag.toString();
|
public java.lang.String | toString()
return "ReadTag[" + myURL.toString() + "]";
|