<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>RE: [jdom-interest] Toward beta 9</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Since my post-with-attachment is waiting for moderator approval, I thought I would post the "diff".</FONT>
</P>
<P><FONT SIZE=2>Just paste the following at the beginning of the Verifier class.</FONT>
</P>
<P><FONT SIZE=2>Rolf</FONT>
</P>
<P><FONT SIZE=2>=================================================</FONT>
<BR><FONT SIZE=2> private static long[] shifts = buildshifts();</FONT>
<BR><FONT SIZE=2> private static long[] lettermask = buildLetterMask(); </FONT>
<BR><FONT SIZE=2> private static long[] combmask = buildCombinationMask();</FONT>
</P>
<P><FONT SIZE=2> private static boolean getbit(long[] mask, int index) {</FONT>
<BR><FONT SIZE=2> return (mask[index >>> 6] & shifts[index & 0x3f]) != 0L;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> private static void setbit(long[] mask, int index) {</FONT>
<BR><FONT SIZE=2> mask[index >>> 6] |= shifts[index & 0x3f];</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2> private static void setbits(long[] mask, int start, int end) {</FONT>
<BR><FONT SIZE=2> for (int i = start; i <= end; i++) {</FONT>
<BR><FONT SIZE=2> setbit(mask,i);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2> private static long[] buildshifts() {</FONT>
<BR><FONT SIZE=2> long[] shifts = new long[64];</FONT>
<BR><FONT SIZE=2> for (int i = 0; i < 64; i++) {</FONT>
<BR><FONT SIZE=2> shifts[i] = (1L << i);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> return shifts;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> private static long[] newmask() {</FONT>
<BR><FONT SIZE=2> // 0x400 == (0xffff + 1) / 64</FONT>
<BR><FONT SIZE=2> return new long[0x400];</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2> private static long[] buildLetterMask() {</FONT>
<BR><FONT SIZE=2> System.out.println ("Building lettermask");</FONT>
<BR><FONT SIZE=2> long tm = System.currentTimeMillis();</FONT>
<BR><FONT SIZE=2> long[] mask = newmask();</FONT>
</P>
<P><FONT SIZE=2> setbits(mask, 0x0041, 0x005a);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0061, 0x007A);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x00C0, 0x00D6);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x00D8, 0x00F6);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x00F8, 0x00FF);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0100, 0x0131);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0134, 0x013E);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0141, 0x0148);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x014A, 0x017E);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0180, 0x01C3);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x01CD, 0x01F0);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x01F4, 0x01F5);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x01FA, 0x0217);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0250, 0x02A8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x02BB, 0x02C1);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0386);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0388, 0x038A);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x038C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x038E, 0x03A1);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x03A3, 0x03CE);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x03D0, 0x03D6);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x03DA);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x03DC);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x03DE);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x03E0);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x03E2, 0x03F3);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0401, 0x040C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x040E, 0x044F);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0451, 0x045C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x045E, 0x0481);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0490, 0x04C4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x04C7, 0x04C8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x04CB, 0x04CC);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x04D0, 0x04EB);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x04EE, 0x04F5);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x04F8, 0x04F9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0531, 0x0556);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0559);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0561, 0x0586);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x05D0, 0x05EA);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x05F0, 0x05F2);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0621, 0x063A);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0641, 0x064A);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0671, 0x06B7);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06BA, 0x06BE);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06C0, 0x06CE);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06D0, 0x06D3);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x06D5);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06E5, 0x06E6);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0905, 0x0939);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x093D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0958, 0x0961);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0985, 0x098C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x098F, 0x0990);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0993, 0x09A8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09AA, 0x09B0);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x09B2);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09B6, 0x09B9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09DC, 0x09DD);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09DF, 0x09E1);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09F0, 0x09F1);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A05, 0x0A0A);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A0F, 0x0A10);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A13, 0x0A28);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A2A, 0x0A30);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A32, 0x0A33);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A35, 0x0A36);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A38, 0x0A39);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A59, 0x0A5C);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0A5E);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A72, 0x0A74);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A85, 0x0A8B);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0A8D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A8F, 0x0A91);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A93, 0x0AA8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0AAA, 0x0AB0);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0AB2, 0x0AB3);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0AB5, 0x0AB9);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0ABD);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0AE0);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B05, 0x0B0C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B0F, 0x0B10);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B13, 0x0B28);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B2A, 0x0B30);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B32, 0x0B33);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B36, 0x0B39);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0B3D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B5C, 0x0B5D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B5F, 0x0B61);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B85, 0x0B8A);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B8E, 0x0B90);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B92, 0x0B95);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B99, 0x0B9A);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0B9C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B9E, 0x0B9F);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BA3, 0x0BA4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BA8, 0x0BAA);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BAE, 0x0BB5);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BB7, 0x0BB9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C05, 0x0C0C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C0E, 0x0C10);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C12, 0x0C28);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C2A, 0x0C33);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C35, 0x0C39);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C60, 0x0C61);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C85, 0x0C8C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C8E, 0x0C90);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C92, 0x0CA8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CAA, 0x0CB3);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CB5, 0x0CB9);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0CDE);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CE0, 0x0CE1);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D05, 0x0D0C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D0E, 0x0D10);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D12, 0x0D28);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D2A, 0x0D39);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D60, 0x0D61);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E01, 0x0E2E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0E30);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E32, 0x0E33);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E40, 0x0E45);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E81, 0x0E82);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0E84);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E87, 0x0E88);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0E8A);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0E8D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E94, 0x0E97);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E99, 0x0E9F);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EA1, 0x0EA3);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0EA5);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0EA7);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EAA, 0x0EAB);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EAD, 0x0EAE);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0EB0);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EB2, 0x0EB3);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0EBD);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EC0, 0x0EC4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F40, 0x0F47);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F49, 0x0F69);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x10A0, 0x10C5);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x10D0, 0x10F6);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1100);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1102, 0x1103);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1105, 0x1107);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1109);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x110B, 0x110C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x110E, 0x1112);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x113C);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x113E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1140);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x114C);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x114E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1150);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1154, 0x1155);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1159);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x115F, 0x1161);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1163);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1165);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1167);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1169);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x116D, 0x116E);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1172, 0x1173);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1175);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x119E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x11A8);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x11AB);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x11AE, 0x11AF);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x11B7, 0x11B8);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x11BA);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x11BC, 0x11C2);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x11EB);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x11F0);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x11F9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1E00, 0x1E9B);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1EA0, 0x1EF9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F00, 0x1F15);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F18, 0x1F1D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F20, 0x1F45);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F48, 0x1F4D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F50, 0x1F57);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1F59);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1F5B);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1F5D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F5F, 0x1F7D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1F80, 0x1FB4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FB6, 0x1FBC);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x1FBE);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FC2, 0x1FC4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FC6, 0x1FCC);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FD0, 0x1FD3);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FD6, 0x1FDB);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FE0, 0x1FEC);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FF2, 0x1FF4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x1FF6, 0x1FFC);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x2126);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x212A, 0x212B);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x212E);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x2180, 0x2182);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x3007); // ideographic</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x3021, 0x3029); // ideo</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x3041, 0x3094);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x30A1, 0x30FA);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x3105, 0x312C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x4E00, 0x9FA5); // ideo</FONT>
<BR><FONT SIZE=2> setbits(mask, 0xAC00, 0xD7A3);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> System.out.println ("Done in " + (System.currentTimeMillis() - tm) + "ms.");</FONT>
<BR><FONT SIZE=2> return mask;</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<BR>
<P><FONT SIZE=2> private static long[] buildCombinationMask() {</FONT>
<BR><FONT SIZE=2> System.out.println ("Building combinationmask");</FONT>
<BR><FONT SIZE=2> long tm = System.currentTimeMillis();</FONT>
<BR><FONT SIZE=2> long[] mask = newmask();</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0300, 0x0345);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0360, 0x0361);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0483, 0x0486);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0591, 0x05A1);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x05A3, 0x05B9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x05BB, 0x05BD);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x05BF);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x05C1, 0x05C2);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbit(mask, 0x05C4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x064B, 0x0652);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0670);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06D6, 0x06DC);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06DD, 0x06DF);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06E0, 0x06E4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06E7, 0x06E8);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x06EA, 0x06ED);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0901, 0x0903);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x093C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x093E, 0x094C);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbit(mask, 0x094D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0951, 0x0954);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0962, 0x0963);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0981, 0x0983);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbit(mask, 0x09BC);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x09BE);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x09BF);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09C0, 0x09C4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09C7, 0x09C8);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09CB, 0x09CD);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x09D7);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x09E2, 0x09E3);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0A02);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0A3C);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0A3E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0A3F);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A40, 0x0A42);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A47, 0x0A48);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A4B, 0x0A4D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A70, 0x0A71);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0A81, 0x0A83);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0ABC);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0ABE, 0x0AC5);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0AC7, 0x0AC9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0ACB, 0x0ACD);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B01, 0x0B03);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0B3C);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B3E, 0x0B43);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B47, 0x0B48);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B4B, 0x0B4D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B56, 0x0B57);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0B82, 0x0B83);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BBE, 0x0BC2);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BC6, 0x0BC8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0BCA, 0x0BCD);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0BD7);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C01, 0x0C03);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C3E, 0x0C44);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C46, 0x0C48);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C4A, 0x0C4D);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C55, 0x0C56);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0C82, 0x0C83);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CBE, 0x0CC4);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CC6, 0x0CC8);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CCA, 0x0CCD);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0CD5, 0x0CD6);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D02, 0x0D03);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D3E, 0x0D43);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D46, 0x0D48);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0D4A, 0x0D4D);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0D57);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0E31);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E34, 0x0E3A);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0E47, 0x0E4E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0EB1);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EB4, 0x0EB9);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EBB, 0x0EBC);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0EC8, 0x0ECD);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F18, 0x0F19);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0F35);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0F37);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0F39);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0F3E);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0F3F);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F71, 0x0F84);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F86, 0x0F8B);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F90, 0x0F95);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0F97);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0F99, 0x0FAD);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x0FB1, 0x0FB7);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x0FB9);</FONT>
<BR><FONT SIZE=2> setbits(mask, 0x20D0, 0x20DC);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x20E1);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> setbits(mask, 0x302A, 0x302F);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x3099);</FONT>
<BR><FONT SIZE=2> setbit(mask, 0x309A); </FONT>
<BR><FONT SIZE=2> System.out.println ("Done in " + (System.currentTimeMillis() - tm) + "ms.");</FONT>
<BR><FONT SIZE=2> return mask;</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2> public static boolean newisXMLLetter(char c) {</FONT>
<BR><FONT SIZE=2> return getbit(lettermask, c);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> public static boolean newisXMLCombiningChar(char c) {</FONT>
<BR><FONT SIZE=2> return getbit(combmask, c);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> public static void main(String[] args) throws IOException {</FONT>
<BR><FONT SIZE=2> int cnt = new Integer(args[0]).intValue();</FONT>
<BR><FONT SIZE=2> for (int i = 1; i < args.length; i++) {</FONT>
<BR><FONT SIZE=2> BufferedReader reader = new BufferedReader(new FileReader(args[i]));</FONT>
<BR><FONT SIZE=2> StringBuffer sb = new StringBuffer();</FONT>
<BR><FONT SIZE=2> String line;</FONT>
<BR><FONT SIZE=2> while ((line = reader.readLine()) != null) {</FONT>
<BR><FONT SIZE=2> sb.append(line + "\n");</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> char[] chars = sb.toString().toCharArray();</FONT>
<BR><FONT SIZE=2> double rate;</FONT>
<BR><FONT SIZE=2> long tm;</FONT>
<BR><FONT SIZE=2> for (int c = 0; c < cnt; c++) {</FONT>
</P>
<P><FONT SIZE=2> int oldcnt = 0;</FONT>
<BR><FONT SIZE=2> int newcnt = 0;</FONT>
</P>
<P><FONT SIZE=2> tm = System.currentTimeMillis();</FONT>
<BR><FONT SIZE=2> for (int x = 0; x < chars.length; x++) {</FONT>
<BR><FONT SIZE=2> if (isXMLLetter(chars[x])) oldcnt++;</FONT>
<BR><FONT SIZE=2> if (isXMLCombiningChar(chars[x])) oldcnt++;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> tm = System.currentTimeMillis() - tm;</FONT>
<BR><FONT SIZE=2> rate = (double)(tm * 10000) / (double)chars.length;</FONT>
<BR><FONT SIZE=2> rate = (double)((int)(rate * 100.0)) / 100.0;</FONT>
<BR><FONT SIZE=2> System.out.println("OLD Iteration " + args[i] + " count " + c + " took " + rate + "ms/10000 chars, counted " + oldcnt + " trues in " + chars.length + " characters .");</FONT></P>
<P><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> tm = System.currentTimeMillis();</FONT>
<BR><FONT SIZE=2> for (int x = 0; x < chars.length; x++) {</FONT>
<BR><FONT SIZE=2> if (newisXMLLetter(chars[x])) newcnt++;</FONT>
<BR><FONT SIZE=2> if (newisXMLCombiningChar(chars[x])) newcnt++;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> tm = System.currentTimeMillis() - tm;</FONT>
<BR><FONT SIZE=2> rate = (double)(tm * 10000) / (double)chars.length;</FONT>
<BR><FONT SIZE=2> rate = (double)((int)(rate * 100.0)) / 100.0;</FONT>
<BR><FONT SIZE=2> System.out.println("NEW Iteration " + args[i] + " count " + c + " took " + rate + "ms/10000 chars, counted " + oldcnt + " trues in " + chars.length + " characters .");</FONT></P>
<P><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2>===========================================</FONT>
</P>
<BR>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Rolf Lear [<A HREF="mailto:rlear@algorithmics.com">mailto:rlear@algorithmics.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, April 10, 2003 10:26 AM</FONT>
<BR><FONT SIZE=2>To: 'Elliotte Rusty Harold'; jdom-interest@jdom.org</FONT>
<BR><FONT SIZE=2>Subject: RE: [jdom-interest] Toward beta 9</FONT>
</P>
<BR>
<P><FONT SIZE=2>How serious are people about performance in Verifier? </FONT>
<BR><FONT SIZE=2>Using a relatively random input source (the characters in various Jars), I can get a 500% - 1000% performance improvement in Verifier.</FONT></P>
<P><FONT SIZE=2>This is relatively simple, and "just as logical" as the existing verifier. </FONT>
<BR><FONT SIZE=2>Have a look at the attached code, it is a "new" Verifier, with a main method which has a relatively clunky, but effective performance test comparison between the existing checks, and the proposed checks.</FONT></P>
<P><FONT SIZE=2>On my linux box I am getting performance improvements from 5.6 ms/10000 chars to 0.7ms/10000 chars. I know that the numbers are rough, but people with profilers may be able to substantiate them better.</FONT></P>
<P><FONT SIZE=2>The basic principal is to build a bitmask representing all the valid letters/combinations. The bitmask has 0xffff+1 bits, i.e. is 8K (relatively small), and there is 1 for each "test". I have done only the isXMLLetter, and isXMLCombiner. The pre-processing overhead is relatively small, (on my box I measure 23ms).</FONT></P>
<P><FONT SIZE=2>Have a look-see, and tell me if I am barking up the wrong tree. I haven't neatened up the code too much, but the principal seems good.</FONT></P>
<P><FONT SIZE=2>I have been running: </FONT>
<BR><FONT SIZE=2>ant package </FONT>
<BR><FONT SIZE=2>java -cp build/jdom.jar org.jdom.Verifier 5 lib/*.jar </FONT>
<BR><FONT SIZE=2>and getting results: </FONT>
<BR><FONT SIZE=2>Building lettermask </FONT>
<BR><FONT SIZE=2>Done in 22ms. </FONT>
<BR><FONT SIZE=2>Building combinationmask </FONT>
<BR><FONT SIZE=2>Done in 0ms. </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/ant.jar count 0 took 6.93ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/ant.jar count 0 took 0.76ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/ant.jar count 1 took 5.61ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/ant.jar count 1 took 0.76ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/ant.jar count 2 took 5.66ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/ant.jar count 2 took 0.76ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/ant.jar count 3 took 5.69ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/ant.jar count 3 took 0.76ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/ant.jar count 4 took 5.61ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/ant.jar count 4 took 0.76ms/10000 chars, counted 176182 trues in 732481 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/jaxen-core.jar count 0 took 5.34ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/jaxen-core.jar count 0 took 0.86ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/jaxen-core.jar count 1 took 5.34ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/jaxen-core.jar count 1 took 0.8ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/jaxen-core.jar count 2 took 5.34ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/jaxen-core.jar count 2 took 0.8ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/jaxen-core.jar count 3 took 5.34ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/jaxen-core.jar count 3 took 0.8ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>OLD Iteration lib/jaxen-core.jar count 4 took 5.34ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>NEW Iteration lib/jaxen-core.jar count 4 took 0.8ms/10000 chars, counted 41039 trues in 160965 characters . </FONT>
<BR><FONT SIZE=2>........ </FONT>
</P>
<BR>
<P><FONT SIZE=2>Rolf </FONT>
</P>
<BR>
<P><FONT SIZE=2>-----Original Message----- </FONT>
<BR><FONT SIZE=2>From: Elliotte Rusty Harold [<A HREF="mailto:elharo@metalab.unc.edu">mailto:elharo@metalab.unc.edu</A>] </FONT>
<BR><FONT SIZE=2>Sent: Thursday, April 10, 2003 7:54 AM </FONT>
<BR><FONT SIZE=2>To: jdom-interest@jdom.org </FONT>
<BR><FONT SIZE=2>Subject: Re: [jdom-interest] Toward beta 9 </FONT>
</P>
<BR>
<P><FONT SIZE=2>At 10:55 PM -0700 4/9/03, Philip Nelson wrote: </FONT>
<BR><FONT SIZE=2>>Has anybody tried this approach? </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>>create a package protected or inner subclass of DefaultJDOMFactory in </FONT>
<BR><FONT SIZE=2>>SAXBuilder. Then in the factory, for example... </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> private class NoCheckText extends Text </FONT>
<BR><FONT SIZE=2>> { </FONT>
<BR><FONT SIZE=2>> public void noCheck(String text) { </FONT>
<BR><FONT SIZE=2>> value = text; </FONT>
<BR><FONT SIZE=2>> } </FONT>
<BR><FONT SIZE=2>> } </FONT>
<BR><FONT SIZE=2>> public Text text(String text) { </FONT>
<BR><FONT SIZE=2>> NoCheckText t = new NoCheckText(); </FONT>
<BR><FONT SIZE=2>> t.noCheck(text); </FONT>
<BR><FONT SIZE=2>> return (Text) t; </FONT>
<BR><FONT SIZE=2>> } </FONT>
</P>
<BR>
<P><FONT SIZE=2>That looks like it might actually work without causing too many </FONT>
<BR><FONT SIZE=2>problems or further complicating the API, though it does depend on </FONT>
<BR><FONT SIZE=2>those protected, do-nothing, no-args constructors that I wish we </FONT>
<BR><FONT SIZE=2>didn't have. </FONT>
<BR><FONT SIZE=2>-- </FONT>
</P>
</BODY>
</HTML>