[Htmlparser-cvs] htmlparser/src/org/htmlparser/lexer Cursor.java,1.16,1.17
Brought to you by:
derrickoswald
From: <der...@us...> - 2004-01-02 19:32:08
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer In directory sc8-pr-cvs1:/tmp/cvs-serv4635/src/org/htmlparser/lexer Modified Files: Cursor.java Log Message: Gey keyword substitution working. In the future, could developers ensure source files are initially check in with keyword substitution (-kkv) turned on. Index: Cursor.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/Cursor.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Cursor.java 2 Jan 2004 16:24:53 -0000 1.16 --- Cursor.java 2 Jan 2004 19:32:04 -0000 1.17 *************** *** 116,118 **** --- 116,163 ---- { return ((Cursor)clone ()); + } + catch (CloneNotSupportedException cnse) + { + return (new Cursor (getPage (), getPosition ())); + } + } + + public String toString () + { + int row; + int column; + StringBuffer ret; + + ret = new StringBuffer (9 * 3 + 3); // three ints and delimiters + ret.append (getPosition ()); + ret.append ("["); + if (null != mPage) + ret.append (mPage.row (this)); + else + ret.append ("?"); + ret.append (","); + if (null != mPage) + ret.append (mPage.column (this)); + else + ret.append ("?"); + ret.append ("]"); + + return (ret.toString ()); + } + + // + // Ordered interface + // + + /** + * Compare one reference to another. + * @see org.htmlparser.util.sort.Ordered + */ + public int compare (Object that) + { + Cursor r = (Cursor)that; + return (getPosition () - r.getPosition ()); + } + } + |