|
Post by Sylph on Jan 30, 2002 12:04:38 GMT -5
what is TagIterator supposed to do? is it supposed to implement an iterator, like get all the tags in the constructor, when it is being constructed? i assume there's not going to be an add method, since Iterator doesn't have one. in what method is it supposed to do this?
|
|
|
Post by EurasianVixen on Jan 31, 2002 23:57:41 GMT -5
Is there suppose to be a main method included? Or do we have to make something like TagIteratorTest class that drives TagIterator?
|
|
|
Post by Brutal_Chicken on Feb 2, 2002 11:57:32 GMT -5
Seeing that we can assume correct input does that mean that something like
<html> <head> <title>Sample input file</title> </head> <body bgcolor="#FFFFFF"> <ul> gajghjajhjah <li>
would only return the tags before the gibberish? For TagIterator that seems to be the case since we can use correct html files.
|
|
|
Post by Brutal_Chicken on Feb 2, 2002 12:01:30 GMT -5
Is there suppose to be a main method included? Or do we have to make something like TagIteratorTest class that drives TagIterator? The main method should be in your test class and not submitted with TagIterator. All you have to do is fill in the blanks of the two methods, add the two methods they give you (from the handout and the hints) and you're done. Think of an iterator as a secretary standing behind a pile of folders. You can ask your secretary if there are any more folders and to hand you the next folder (and to remove the last one, but we're not doing that so don't bother). Nothing weird about it like in the CircularQueue tutorial assignment.
|
|
|
Post by Sylph on Feb 2, 2002 14:12:32 GMT -5
Seeing that we can assume correct input does that mean that something like <html> <head> <title>Sample input file</title> </head> <body bgcolor="#FFFFFF"> <ul> gajghjajhjah <li> would only return the tags before the gibberish? For TagIterator that seems to be the case since we can use correct html files. i'm not sure what u mean, but i believe <title> is one tag, and </title> is another tag. i read it somewhere in the newsgroup or announcements, but i can't find it anymore...
|
|
|
Post by Random_Death on Feb 2, 2002 19:02:27 GMT -5
<title>Sample input file</title> Yep that is 2 separate tags.
|
|
|
Post by Yingster on Feb 3, 2002 21:51:04 GMT -5
just curious are ur codes really long??
|
|
|
Post by Random_Death on Feb 3, 2002 21:52:24 GMT -5
Nope, part 2 is pretty short.
|
|
|
Post by Yingster on Feb 3, 2002 21:55:06 GMT -5
i mean class TagIterator
|
|
|
Post by Random_Death on Feb 3, 2002 22:13:33 GMT -5
My TagIterator is pretty short and my LinkIterator is even shorter.
|
|
|
Post by EurasianVixen on Feb 3, 2002 23:24:58 GMT -5
Is this input still valid b/c it contains the ABCDEF? Do we have to handle that type of thing or can we assume that all lines of input will inlude a <> ?? Thx. <head> <body> ABCDEF <blah> </head>
|
|
|
Post by Random_Death on Feb 3, 2002 23:37:26 GMT -5
yep!
|
|
|
Post by SquirrelHunterPro on Feb 4, 2002 12:31:23 GMT -5
for some odd reason, without the copy and paste parts, my tagiterator code is only 15 lines long including the stupid end braces... Theres got to be something wrong, cause if this is the case then the chances that 2 programs will be near identical would be --> 1
anyways, all I have are: 2 lines in the hasnext() and a chunk of loops and if nests under next(). and the question would be, i dont get what we do with the constructor... the client sends in a buffered reader type variable??? how is that possible?
|
|
|
Post by Sky on Feb 4, 2002 21:12:09 GMT -5
if u want to make the code longer...there are alot of ways to do that...try think about what kind of link tags your program can't handle some suggestion are: <"" = href> <"href = """> <href hihi = hihi "hehe">
those are not valid links but could be valid input tho...see more about that in the newsgroup...
|
|
Poopo
Full Member
Posts: 43
|
Post by Poopo on Feb 5, 2002 23:37:36 GMT -5
I don't know... they said valid HTML input. Based on the CSC148 board and this board:
- It says no nested tags- "Are we required to handle a "tag close" character in between tags, i.e. <tag> some > text </tag> or would this be considered invalid input?
Thanks."
Prof/TA says: This is valid input. (But does it really affect your code?)
--- so what would be the returned tag?
- How bout gaps in the HTML file? do we have to account for that? <html> <--- gap? <header>
|
|