From: <br...@us...> - 2006-06-14 10:22:42
|
Revision: 3701 Author: brihaye Date: 2006-06-14 03:22:36 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/exist/?rev=3701&view=rev Log Message: ----------- Added toString() method Modified Paths: -------------- trunk/eXist-1.0/src/org/exist/storage/ElementValue.java Modified: trunk/eXist-1.0/src/org/exist/storage/ElementValue.java =================================================================== --- trunk/eXist-1.0/src/org/exist/storage/ElementValue.java 2006-06-13 20:13:55 UTC (rev 3700) +++ trunk/eXist-1.0/src/org/exist/storage/ElementValue.java 2006-06-14 10:22:36 UTC (rev 3701) @@ -82,4 +82,23 @@ short getCollectionId() { return ByteConversion.byteToShort(data, 0); } + + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append("Collection id : " + ByteConversion.byteToShort(data, 0)); + if (len > 2) + buf.append(" Type : " + type[data[2]]); + + if (len > 7) { + buf.append(" idValue : " + UTF8.decode(data, 4, data.length - 3)); //untested + } else { + //TODO : could we have a string in the cases below ? + if (len > 3) + buf.append(" Symbol id : " + ByteConversion.byteToShort(data, 3)); + if (len > 5) + buf.append(" NSSymbol id : " + ByteConversion.byteToShort(data, 5)); + } + + return buf.toString(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |