[Htmlparser-cvs] htmlparser/src/org/htmlparser/util ChainedException.java,1.38,1.39 CommandLine.java
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util In directory sc8-pr-cvs1:/tmp/cvs-serv24483/src/org/htmlparser/util Modified Files: ChainedException.java CommandLine.java DefaultParserFeedback.java FeedbackManager.java Generate.java IteratorImpl.java LinkProcessor.java NodeIterator.java NodeList.java ParserException.java ParserFeedback.java ParserUtils.java PeekingIterator.java SimpleNodeIterator.java Translate.java package.html Log Message: Add style checking target to ant build script: ant checkstyle It uses a jar from http://checkstyle.sourceforge.net which is dropped in the lib directory. The rules are in the file htmlparser_checks.xml in the src directory. Added lexerapplications package with Tabby as the first app. It performs whitespace manipulation on source files to follow the style rules. This reduced the number of style violations to roughly 14,000. There are a few issues with the style checker that need to be resolved before it should be taken too seriously. For example: It thinks all method arguments should be final, even if they are modified by the code (which the compiler frowns on). It complains about long lines, even when there is no possibility of wrapping the line, i.e. a URL in a comment that's more than 80 characters long. It considers all naked integers as 'magic numbers', even when they are obvious, i.e. the 4 corners of a box. It complains about whitespace following braces, even in array initializers, i.e. X[][] = { {a, b} { } } But it points out some really interesting things, even if you don't agree with the style guidelines, so it's worth a look. Index: ChainedException.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/ChainedException.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ChainedException.java 8 Sep 2003 02:26:32 -0000 1.38 --- ChainedException.java 10 Sep 2003 03:38:25 -0000 1.39 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,31 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com ! // ! // This class was contributed by // Claude Duguay // --- 18,31 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com ! // ! // This class was contributed by // Claude Duguay // *************** *** 78,87 **** super(message); } ! public ChainedException(Throwable throwable) { this.throwable = throwable; } ! public ChainedException(String message, Throwable throwable) { --- 78,87 ---- super(message); } ! public ChainedException(Throwable throwable) { this.throwable = throwable; } ! public ChainedException(String message, Throwable throwable) { *************** *** 89,93 **** this.throwable = throwable; } ! public String[] getMessageChain() { --- 89,93 ---- this.throwable = throwable; } ! public String[] getMessageChain() { *************** *** 97,101 **** return chain; } ! public Vector getMessageList() { --- 97,101 ---- return chain; } ! public Vector getMessageList() { *************** *** 122,136 **** return list; } ! public Throwable getThrowable() { return throwable; } ! public void printStackTrace() { printStackTrace(System.err); } ! public void printStackTrace(PrintStream out) { --- 122,136 ---- return list; } ! public Throwable getThrowable() { return throwable; } ! public void printStackTrace() { printStackTrace(System.err); } ! public void printStackTrace(PrintStream out) { Index: CommandLine.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/CommandLine.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** CommandLine.java 8 Sep 2003 02:26:33 -0000 1.36 --- CommandLine.java 10 Sep 2003 03:38:25 -0000 1.37 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 74,83 **** parse(args); } ! public CommandLine(String[] args) { parse(args); } ! protected void parse(String[] args) { --- 74,83 ---- parse(args); } ! public CommandLine(String[] args) { parse(args); } ! protected void parse(String[] args) { *************** *** 90,94 **** nextArg = args[i + 1]; } ! if (thisArg.startsWith("-")) { --- 90,94 ---- nextArg = args[i + 1]; } ! if (thisArg.startsWith("-")) { *************** *** 139,173 **** } } ! public void addCommand(char command) { commands.add(new Character(command)); } ! public boolean hasValue(String key) { return values.containsKey(key); } ! public String getValue(String key) { return (String)values.get(key); } ! public boolean getFlag(String key) { return flags.contains(key); } ! public int getNameCount() { return names.size(); } ! public String getName(int index) { return (String)names.get(index); } ! public static void main(String[] args) { --- 139,173 ---- } } ! public void addCommand(char command) { commands.add(new Character(command)); } ! public boolean hasValue(String key) { return values.containsKey(key); } ! public String getValue(String key) { return (String)values.get(key); } ! public boolean getFlag(String key) { return flags.contains(key); } ! public int getNameCount() { return names.size(); } ! public String getName(int index) { return (String)names.get(index); } ! public static void main(String[] args) { Index: DefaultParserFeedback.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/DefaultParserFeedback.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DefaultParserFeedback.java 8 Sep 2003 02:26:33 -0000 1.25 --- DefaultParserFeedback.java 10 Sep 2003 03:38:25 -0000 1.26 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 84,88 **** public DefaultParserFeedback (int mode) { ! if (mode<QUIET||mode>DEBUG) throw new IllegalArgumentException ( "illegal mode (" --- 84,88 ---- public DefaultParserFeedback (int mode) { ! if (mode<QUIET||mode>DEBUG) throw new IllegalArgumentException ( "illegal mode (" *************** *** 109,113 **** System.out.println ("INFO: " + message); } ! /** * Print an warning message. --- 109,113 ---- System.out.println ("INFO: " + message); } ! /** * Print an warning message. *************** *** 119,123 **** System.out.println ("WARNING: " + message); } ! /** * Print an error message. --- 119,123 ---- System.out.println ("WARNING: " + message); } ! /** * Print an error message. Index: FeedbackManager.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/FeedbackManager.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** FeedbackManager.java 8 Sep 2003 02:26:33 -0000 1.38 --- FeedbackManager.java 10 Sep 2003 03:38:25 -0000 1.39 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com Index: Generate.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/Generate.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Generate.java 8 Sep 2003 02:26:33 -0000 1.40 --- Generate.java 10 Sep 2003 03:38:25 -0000 1.41 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,31 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com ! // ! // This class was contributed by // Derrick Oswald // --- 18,31 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com ! // ! // This class was contributed by // Derrick Oswald // *************** *** 62,66 **** */ protected Parser parser; ! /** * The system specific line separator string. --- 62,66 ---- */ protected Parser parser; ! /** * The system specific line separator string. *************** *** 90,94 **** * @param string The raw string. * @return The string with character references fixed. ! */ public String translate (String string) { --- 90,94 ---- * @param string The raw string. * @return The string with character references fixed. ! */ public String translate (String string) { *************** *** 96,102 **** int amp; StringBuffer ret; ! ret = new StringBuffer (4096); ! index = 0; while ((index < string.length ()) && (-1 != (amp = string.indexOf ('&', index)))) --- 96,102 ---- int amp; StringBuffer ret; ! ret = new StringBuffer (4096); ! index = 0; while ((index < string.length ()) && (-1 != (amp = string.indexOf ('&', index)))) *************** *** 147,157 **** } ret.append (string.substring (index)); ! return (ret.toString ()); } ! /** * Pull out text elements from the HTML. ! */ public void parse () throws --- 147,157 ---- } ret.append (string.substring (index)); ! return (ret.toString ()); } ! /** * Pull out text elements from the HTML. ! */ public void parse () throws *************** *** 166,170 **** { node = e.nextNode (); ! if (node instanceof StringNode) { --- 166,170 ---- { node = e.nextNode (); ! if (node instanceof StringNode) { *************** *** 204,208 **** } } ! String text = translate (buffer.toString ()); sgml (text); --- 204,208 ---- } } ! String text = translate (buffer.toString ()); sgml (text); *************** *** 232,236 **** return (ret); } ! /** * Rewrite the comment string. --- 232,236 ---- return (ret); } ! /** * Rewrite the comment string. *************** *** 249,253 **** int spaces; StringBuffer ret; ! ret = new StringBuffer (string.length ()); --- 249,253 ---- int spaces; StringBuffer ret; ! ret = new StringBuffer (string.length ()); *************** *** 266,278 **** if (index < string.length ()) ret.append (string.substring (index)); ! return (ret.toString ()); } ! /** * Pretty up a comment string. * @param string The comment to operate on. * @return The beautiful comment string. ! */ public String pretty (String string) { --- 266,278 ---- if (index < string.length ()) ret.append (string.substring (index)); ! return (ret.toString ()); } ! /** * Pretty up a comment string. * @param string The comment to operate on. * @return The beautiful comment string. ! */ public String pretty (String string) { *************** *** 280,284 **** int spaces; StringBuffer ret; ! ret = new StringBuffer (string.length ()); --- 280,284 ---- int spaces; StringBuffer ret; ! ret = new StringBuffer (string.length ()); *************** *** 296,300 **** if (index < string.length ()) ret.append (" // " + string.substring (index)); ! return (ret.toString ()); } --- 296,300 ---- if (index < string.length ()) ret.append (" // " + string.substring (index)); ! return (ret.toString ()); } *************** *** 306,319 **** * @param length The size to pad to. * @return The padded string. ! */ public String pad (String string, char character, int length) { StringBuffer ret; ! ret = new StringBuffer (length); ret.append (string); while (length > ret.length ()) ret.insert (0, character); ! return (ret.toString ()); } --- 306,319 ---- * @param length The size to pad to. * @return The padded string. ! */ public String pad (String string, char character, int length) { StringBuffer ret; ! ret = new StringBuffer (length); ret.append (string); while (length > ret.length ()) ret.insert (0, character); ! return (ret.toString ()); } *************** *** 324,332 **** * @return The character represented by the numeric character reference. * ! */ public String unicode (String string) { int code; ! if (string.startsWith ("\"&#") && string.endsWith (";\"")) { --- 324,332 ---- * @return The character represented by the numeric character reference. * ! */ public String unicode (String string) { int code; ! if (string.startsWith ("\"&#") && string.endsWith (";\"")) { *************** *** 354,358 **** * with the comment. * @param string The contents of the sgml declaration. ! */ public void extract (String string) { --- 354,358 ---- * with the comment. * @param string The contents of the sgml declaration. ! */ public void extract (String string) { *************** *** 412,416 **** int begin; int end; ! index = 0; while (-1 != (begin = string.indexOf ("<", index))) --- 412,416 ---- int begin; int end; ! index = 0; while (-1 != (begin = string.indexOf ("<", index))) Index: IteratorImpl.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/IteratorImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** IteratorImpl.java 8 Sep 2003 02:26:33 -0000 1.26 --- IteratorImpl.java 10 Sep 2003 03:38:25 -0000 1.27 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 72,79 **** throw ex; } ! return (ret); } ! /** * Check if more nodes are available. --- 72,79 ---- throw ex; } ! return (ret); } ! /** * Check if more nodes are available. *************** *** 89,96 **** else ret = !(null == peek ()); ! return (ret); } ! /** * Get the next node. --- 89,96 ---- else ret = !(null == peek ()); ! return (ret); } ! /** * Get the next node. *************** *** 105,109 **** // should perhaps throw an exception? ret = null; ! return (ret); } --- 105,109 ---- // should perhaps throw an exception? ret = null; ! return (ret); } Index: LinkProcessor.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/LinkProcessor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** LinkProcessor.java 8 Sep 2003 02:26:33 -0000 1.25 --- LinkProcessor.java 10 Sep 2003 03:38:25 -0000 1.26 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 65,69 **** { String ret; ! try { --- 65,69 ---- { String ret; ! try { *************** *** 84,88 **** ret = link; } ! return (Translate.decode (ret)); } --- 84,88 ---- ret = link; } ! return (Translate.decode (ret)); } *************** *** 133,137 **** char ch; StringBuffer returnURL; ! index = url.indexOf (' '); if (-1 != index) --- 133,137 ---- char ch; StringBuffer returnURL; ! index = url.indexOf (' '); if (-1 != index) *************** *** 150,157 **** url = returnURL.toString (); } ! return (url); } ! /** * Check if a resource is a valid URL. --- 150,157 ---- url = returnURL.toString (); } ! return (url); } ! /** * Check if a resource is a valid URL. *************** *** 162,166 **** URL url; boolean ret; ! try { --- 162,166 ---- URL url; boolean ret; ! try { *************** *** 172,179 **** ret = false; } ! return (ret); } ! /** * Returns the baseUrl. --- 172,179 ---- ret = false; } ! return (ret); } ! /** * Returns the baseUrl. *************** *** 184,188 **** return baseUrl; } ! /** * Sets the baseUrl. --- 184,188 ---- return baseUrl; } ! /** * Sets the baseUrl. *************** *** 204,207 **** } } ! } --- 204,207 ---- } } ! } Index: NodeIterator.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/NodeIterator.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** NodeIterator.java 8 Sep 2003 02:26:33 -0000 1.26 --- NodeIterator.java 10 Sep 2003 03:38:25 -0000 1.27 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 37,41 **** */ public boolean hasMoreNodes() throws ParserException; ! /** * Get the next node. --- 37,41 ---- */ public boolean hasMoreNodes() throws ParserException; ! /** * Get the next node. *************** *** 43,46 **** */ public Node nextNode() throws ParserException; ! } --- 43,46 ---- */ public Node nextNode() throws ParserException; ! } Index: NodeList.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/NodeList.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** NodeList.java 8 Sep 2003 02:26:33 -0000 1.42 --- NodeList.java 10 Sep 2003 03:38:25 -0000 1.43 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 42,46 **** private int capacityIncrement; private int numberOfAdjustments; ! public NodeList() { size = 0; --- 42,46 ---- private int capacityIncrement; private int numberOfAdjustments; ! public NodeList() { size = 0; *************** *** 50,56 **** numberOfAdjustments = 0; } ! public void add(Node node) { ! if (size==capacity) adjustVectorCapacity(); nodeData[size++]=node; --- 50,56 ---- numberOfAdjustments = 0; } ! public void add(Node node) { ! if (size==capacity) adjustVectorCapacity(); nodeData[size++]=node; *************** *** 73,77 **** public void prepend(Node node) { ! if (size==capacity) adjustVectorCapacity(); System.arraycopy (nodeData, 0, nodeData, 1, size); --- 73,77 ---- public void prepend(Node node) { ! if (size==capacity) adjustVectorCapacity(); System.arraycopy (nodeData, 0, nodeData, 1, size); *************** *** 92,100 **** return new Node[capacity]; } ! public int size() { return size; } ! public Node elementAt(int i) { return nodeData[i]; --- 92,100 ---- return new Node[capacity]; } ! public int size() { return size; } ! public Node elementAt(int i) { return nodeData[i]; *************** *** 104,116 **** return numberOfAdjustments; } ! public SimpleNodeIterator elements() { return new SimpleNodeIterator() { int count = 0; ! public boolean hasMoreNodes() { return count < size; } ! public Node nextNode() { synchronized (NodeList.this) { --- 104,116 ---- return numberOfAdjustments; } ! public SimpleNodeIterator elements() { return new SimpleNodeIterator() { int count = 0; ! public boolean hasMoreNodes() { return count < size; } ! public Node nextNode() { synchronized (NodeList.this) { *************** *** 123,152 **** }; } ! public Node [] toNodeArray() { Node [] nodeArray = newNodeArrayFor(size); ! System.arraycopy(nodeData, 0, nodeArray, 0, size); return nodeArray; } ! public String asString() { StringBuffer buff = new StringBuffer(); ! for (int i=0;i<size;i++) ! buff.append(nodeData[i].toPlainTextString()); return buff.toString(); } ! public String asHtml() { StringBuffer buff = new StringBuffer(); ! for (int i=0;i<size;i++) ! buff.append(nodeData[i].toHtml()); return buff.toString(); } ! public void remove(int index) { ! System.arraycopy(nodeData, index+1, nodeData, index, size-index-1); ! size--; } ! public void removeAll() { size = 0; --- 123,152 ---- }; } ! public Node [] toNodeArray() { Node [] nodeArray = newNodeArrayFor(size); ! System.arraycopy(nodeData, 0, nodeArray, 0, size); return nodeArray; } ! public String asString() { StringBuffer buff = new StringBuffer(); ! for (int i=0;i<size;i++) ! buff.append(nodeData[i].toPlainTextString()); return buff.toString(); } ! public String asHtml() { StringBuffer buff = new StringBuffer(); ! for (int i=0;i<size;i++) ! buff.append(nodeData[i].toHtml()); return buff.toString(); } ! public void remove(int index) { ! System.arraycopy(nodeData, index+1, nodeData, index, size-index-1); ! size--; } ! public void removeAll() { size = 0; *************** *** 156,160 **** numberOfAdjustments = 0; } ! public String toString() { StringBuffer text = new StringBuffer(); --- 156,160 ---- numberOfAdjustments = 0; } ! public String toString() { StringBuffer text = new StringBuffer(); *************** *** 172,176 **** return (searchFor (classType, false)); } ! /** * Search for nodes of the given type recursively. --- 172,176 ---- return (searchFor (classType, false)); } ! /** * Search for nodes of the given type recursively. *************** *** 184,188 **** NodeList children; NodeList ret; ! ret = new NodeList (); name = classType.getName (); --- 184,188 ---- NodeList children; NodeList ret; ! ret = new NodeList (); name = classType.getName (); Index: ParserException.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/ParserException.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ParserException.java 8 Sep 2003 02:26:33 -0000 1.23 --- ParserException.java 10 Sep 2003 03:38:25 -0000 1.24 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 46,55 **** super(message); } ! public ParserException(Throwable throwable) { super(throwable); } ! public ParserException(String message, Throwable throwable) { --- 46,55 ---- super(message); } ! public ParserException(Throwable throwable) { super(throwable); } ! public ParserException(String message, Throwable throwable) { Index: ParserFeedback.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/ParserFeedback.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ParserFeedback.java 8 Sep 2003 02:26:33 -0000 1.24 --- ParserFeedback.java 10 Sep 2003 03:38:25 -0000 1.25 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com Index: ParserUtils.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/ParserUtils.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ParserUtils.java 8 Sep 2003 02:26:33 -0000 1.28 --- ParserUtils.java 10 Sep 2003 03:38:25 -0000 1.29 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 38,42 **** public class ParserUtils { ! public static String toString(Tag tag) { String tagName = tag.getAttribute(Tag.TAGNAME); --- 38,42 ---- public class ParserUtils { ! public static String toString(Tag tag) { String tagName = tag.getAttribute(Tag.TAGNAME); *************** *** 64,68 **** return tempScanners; } ! public static void restoreScanners(NodeReader reader, Map tempScanners) { // Flush the scanners --- 64,68 ---- return tempScanners; } ! public static void restoreScanners(NodeReader reader, Map tempScanners) { // Flush the scanners Index: PeekingIterator.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/PeekingIterator.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PeekingIterator.java 8 Sep 2003 02:26:33 -0000 1.14 --- PeekingIterator.java 10 Sep 2003 03:38:25 -0000 1.15 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,27 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 18,27 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com Index: SimpleNodeIterator.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/SimpleNodeIterator.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** SimpleNodeIterator.java 8 Sep 2003 02:26:33 -0000 1.28 --- SimpleNodeIterator.java 10 Sep 2003 03:38:25 -0000 1.29 *************** *** 1,27 **** // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com --- 1,27 ---- // HTMLParser Library v1_4_20030907 - A java-based parser for HTML // Copyright (C) Dec 31, 2000 Somik Raha ! // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. ! // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com *************** *** 50,54 **** * Get the next node. * @return The next node in the HTML stream, or null if there are no more ! * nodes. */ public Node nextNode(); --- 50,54 ---- * Get the next node. * @return The next node in the HTML stream, or null if there are no more ! * nodes. */ public Node nextNode(); Index: Translate.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/Translate.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Translate.java 8 Sep 2003 02:26:33 -0000 1.34 --- Translate.java 10 Sep 2003 03:38:25 -0000 1.35 *************** *** 11,15 **** // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software --- 11,15 ---- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. ! // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software *************** *** 18,31 **** // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com ! // ! // This class was contributed by // Derrick Oswald // --- 18,31 ---- // For any questions or suggestions, you can write to me at : // Email :so...@in... ! // ! // Postal Address : // Somik Raha // Extreme Programmer & Coach // Industrial Logic Corporation ! // 2583 Cedar Street, Berkeley, // CA 94708, USA // Website : http://www.industriallogic.com ! // ! // This class was contributed by // Derrick Oswald // *************** *** 470,474 **** return (ret); } ! public static String decode (StringBuffer stringBuffer) { return decode(stringBuffer.toString()); --- 470,474 ---- return (ret); } ! public static String decode (StringBuffer stringBuffer) { return decode(stringBuffer.toString()); Index: package.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/package.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** package.html 8 Sep 2003 02:26:33 -0000 1.13 --- package.html 10 Sep 2003 03:38:25 -0000 1.14 *************** *** 18,22 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. ! You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software --- 18,22 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. ! You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software *************** *** 25,43 **** For any questions or suggestions, you can write to me at : Email :so...@in... ! ! Postal Address : Somik Raha Extreme Programmer & Coach Industrial Logic Corporation ! 2583 Cedar Street, Berkeley, CA 94708, USA Website : http://www.industriallogic.com ! --> </head> <body bgcolor="white"> ! The util package is intended for holding utility classes that dont directly help with the parsing, but can take responsibilities out from some classes. Resuable code which can be reused by many classes, should be located ! in this package. <h2>Related Documentation</h2> --- 25,43 ---- For any questions or suggestions, you can write to me at : Email :so...@in... ! ! Postal Address : Somik Raha Extreme Programmer & Coach Industrial Logic Corporation ! 2583 Cedar Street, Berkeley, CA 94708, USA Website : http://www.industriallogic.com ! --> </head> <body bgcolor="white"> ! The util package is intended for holding utility classes that dont directly help with the parsing, but can take responsibilities out from some classes. Resuable code which can be reused by many classes, should be located ! in this package. <h2>Related Documentation</h2> |