Coverage Report - com.healthmarketscience.jackcess.IndexCodes
 
Classes in this File Line Coverage Branch Coverage Complexity
IndexCodes
99%
269/272
50%
4/8
0
IndexCodes$1
N/A
N/A
0
IndexCodes$InternationalCodes
100%
5/5
N/A
0
 
 1  
 /*
 2  
 Copyright (c) 2008 Health Market Science, Inc.
 3  
 
 4  
 This library is free software; you can redistribute it and/or
 5  
 modify it under the terms of the GNU Lesser General Public
 6  
 License as published by the Free Software Foundation; either
 7  
 version 2.1 of the License, or (at your option) any later version.
 8  
 
 9  
 This library is distributed in the hope that it will be useful,
 10  
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  
 Lesser General Public License for more details.
 13  
 
 14  
 You should have received a copy of the GNU Lesser General Public
 15  
 License along with this library; if not, write to the Free Software
 16  
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 17  
 USA
 18  
 
 19  
 You can contact Health Market Science at info@healthmarketscience.com
 20  
 or at the following address:
 21  
 
 22  
 Health Market Science
 23  
 2700 Horizon Drive
 24  
 Suite 200
 25  
 King of Prussia, PA 19406
 26  
 */
 27  
 
 28  
 package com.healthmarketscience.jackcess;
 29  
 
 30  
 import java.util.HashMap;
 31  
 import java.util.Map;
 32  
 
 33  
 /**
 34  
  * Various constants used for creating index entries.
 35  
  *
 36  
  * @author James Ahlborn
 37  
  */
 38  
 public class IndexCodes {
 39  
 
 40  
   static final byte ASC_START_FLAG = (byte)0x7F;
 41  
   static final byte ASC_NULL_FLAG = (byte)0x00;
 42  
   static final byte DESC_START_FLAG = (byte)0x80;
 43  
   static final byte DESC_NULL_FLAG = (byte)0xFF;
 44  
 
 45  
   static final byte END_TEXT = (byte)0x01;
 46  
 
 47  
   static final byte END_EXTRA_TEXT = (byte)0x00;
 48  
 
 49  
   static final byte ASC_BOOLEAN_TRUE = (byte)0x00;
 50  
   static final byte ASC_BOOLEAN_FALSE = (byte)0xFF;
 51  
   
 52  
   static final byte DESC_BOOLEAN_TRUE = ASC_BOOLEAN_FALSE;
 53  
   static final byte DESC_BOOLEAN_FALSE = ASC_BOOLEAN_TRUE;
 54  
   
 55  
 
 56  
   // unprintable char is removed from normal text.
 57  
   // pattern for unprintable chars in the extra bytes:
 58  
   // 01 01 01 <pos> 06  <code> )
 59  
   // <pos> = 7 + (4 * char_pos) | 0x8000 (as short)
 60  
   // <code> = char code
 61  
   static final int UNPRINTABLE_COUNT_START = 7;
 62  
   static final int UNPRINTABLE_COUNT_MULTIPLIER = 4;
 63  1
   static final byte[] UNPRINTABLE_COMMON_PREFIX =
 64  
     new byte[]{(byte)0x01, (byte)0x01, (byte)0x01};
 65  
   static final int UNPRINTABLE_OFFSET_FLAGS = 0x8000;
 66  
   static final byte UNPRINTABLE_MIDFIX = (byte)0x06;
 67  
 
 68  
   // international char is replaced with ascii char.
 69  
   // pattern for international chars in the extra bytes:
 70  
   // [ 02 (for each normal char) ] [ <symbol_code> (for each inat char) ]
 71  
   static final byte INTERNATIONAL_EXTRA_PLACEHOLDER = (byte)0x02;
 72  
   
 73  
   /**
 74  
    * Map of character to byte[] that Access uses in indexes (not ASCII)
 75  
    * (Character -> byte[]) as codes to order text
 76  
    */
 77  1
   static final Map<Character, byte[]> CODES =
 78  
     new HashMap<Character, byte[]>(150);
 79  
 
 80  
   /**
 81  
    * Map of character to byte[] that Access uses in indexes for unprintable
 82  
    * characters (not ASCII) (Character -> byte[]), in the extended portion
 83  
    */
 84  1
   static final Map<Character, byte[]> UNPRINTABLE_CODES =
 85  
     new HashMap<Character, byte[]>(100);
 86  
   
 87  
   /**
 88  
    * Map of character to byte[] that Access uses in indexes for international
 89  
    * characters (not ASCII) (Character -> InternationalCodes), in the extended
 90  
    * portion
 91  
    */
 92  1
   static final Map<Character, InternationalCodes> INTERNATIONAL_CODES =
 93  
     new HashMap<Character, InternationalCodes>(70);
 94  
   
 95  
   static {
 96  
     
 97  1
     registerCodes('\u0000', new byte[]{});
 98  1
     registerCodes('\t',     new byte[]{(byte)0x08, (byte)0x03});
 99  1
     registerCodes('\n',     new byte[]{(byte)0x08, (byte)0x04});
 100  1
     registerCodes('\u000B', new byte[]{(byte)0x08, (byte)0x05});
 101  1
     registerCodes('\f',     new byte[]{(byte)0x08, (byte)0x06});
 102  1
     registerCodes('\r',     new byte[]{(byte)0x08, (byte)0x07});
 103  1
     registerCodes('\u0020', new byte[]{(byte)0x07});
 104  1
     registerCodes('\u0021', new byte[]{(byte)0x09});
 105  1
     registerCodes('\"',     new byte[]{(byte)0x0A});
 106  1
     registerCodes('\u0023', new byte[]{(byte)0x0C});
 107  1
     registerCodes('\u0024', new byte[]{(byte)0x0E});
 108  1
     registerCodes('\u0025', new byte[]{(byte)0x10});
 109  1
     registerCodes('\u0026', new byte[]{(byte)0x12});
 110  1
     registerCodes('\u0028', new byte[]{(byte)0x14});
 111  1
     registerCodes('\u0029', new byte[]{(byte)0x16});
 112  1
     registerCodes('\u002A', new byte[]{(byte)0x18});
 113  1
     registerCodes('\u002B', new byte[]{(byte)0x2C});
 114  1
     registerCodes('\u002C', new byte[]{(byte)0x1A});
 115  1
     registerCodes('\u002E', new byte[]{(byte)0x1C});
 116  1
     registerCodes('\u002F', new byte[]{(byte)0x1E});
 117  1
     registerCodes('\u0030', new byte[]{(byte)0x36});
 118  1
     registerCodes('\u0031', new byte[]{(byte)0x38});
 119  1
     registerCodes('\u0032', new byte[]{(byte)0x3A});
 120  1
     registerCodes('\u0033', new byte[]{(byte)0x3C});
 121  1
     registerCodes('\u0034', new byte[]{(byte)0x3E});
 122  1
     registerCodes('\u0035', new byte[]{(byte)0x40});
 123  1
     registerCodes('\u0036', new byte[]{(byte)0x42});
 124  1
     registerCodes('\u0037', new byte[]{(byte)0x44});
 125  1
     registerCodes('\u0038', new byte[]{(byte)0x46});
 126  1
     registerCodes('\u0039', new byte[]{(byte)0x48});
 127  1
     registerCodes('\u003A', new byte[]{(byte)0x20});
 128  1
     registerCodes('\u003B', new byte[]{(byte)0x22});
 129  1
     registerCodes('\u003C', new byte[]{(byte)0x2E});
 130  1
     registerCodes('\u003D', new byte[]{(byte)0x30});
 131  1
     registerCodes('\u003E', new byte[]{(byte)0x32});
 132  1
     registerCodes('\u003F', new byte[]{(byte)0x24});
 133  1
     registerCodes('\u0040', new byte[]{(byte)0x26});
 134  1
     registerCodes('\u0041', new byte[]{(byte)0x4A});
 135  1
     registerCodes('\u0042', new byte[]{(byte)0x4C});
 136  1
     registerCodes('\u0043', new byte[]{(byte)0x4D});
 137  1
     registerCodes('\u0044', new byte[]{(byte)0x4F});
 138  1
     registerCodes('\u0045', new byte[]{(byte)0x51});
 139  1
     registerCodes('\u0046', new byte[]{(byte)0x53});
 140  1
     registerCodes('\u0047', new byte[]{(byte)0x55});
 141  1
     registerCodes('\u0048', new byte[]{(byte)0x57});
 142  1
     registerCodes('\u0049', new byte[]{(byte)0x59});
 143  1
     registerCodes('\u004A', new byte[]{(byte)0x5B});
 144  1
     registerCodes('\u004B', new byte[]{(byte)0x5C});
 145  1
     registerCodes('\u004C', new byte[]{(byte)0x5E});
 146  1
     registerCodes('\u004D', new byte[]{(byte)0x60});
 147  1
     registerCodes('\u004E', new byte[]{(byte)0x62});
 148  1
     registerCodes('\u004F', new byte[]{(byte)0x64});
 149  1
     registerCodes('\u0050', new byte[]{(byte)0x66});
 150  1
     registerCodes('\u0051', new byte[]{(byte)0x68});
 151  1
     registerCodes('\u0052', new byte[]{(byte)0x69});
 152  1
     registerCodes('\u0053', new byte[]{(byte)0x6B});
 153  1
     registerCodes('\u0054', new byte[]{(byte)0x6D});
 154  1
     registerCodes('\u0055', new byte[]{(byte)0x6F});
 155  1
     registerCodes('\u0056', new byte[]{(byte)0x71});
 156  1
     registerCodes('\u0057', new byte[]{(byte)0x73});
 157  1
     registerCodes('\u0058', new byte[]{(byte)0x75});
 158  1
     registerCodes('\u0059', new byte[]{(byte)0x76});
 159  1
     registerCodes('\u005A', new byte[]{(byte)0x78});
 160  1
     registerCodes('\u005B', new byte[]{(byte)0x27});
 161  1
     registerCodes('\\',     new byte[]{(byte)0x29});
 162  1
     registerCodes('\u005D', new byte[]{(byte)0x2A});
 163  1
     registerCodes('\u005E', new byte[]{(byte)0x2B, (byte)0x02});
 164  1
     registerCodes('\u005F', new byte[]{(byte)0x2B, (byte)0x03});
 165  1
     registerCodes('\u0060', new byte[]{(byte)0x2B, (byte)0x07});
 166  1
     registerCodes('\u0061', new byte[]{(byte)0x4A});
 167  1
     registerCodes('\u0062', new byte[]{(byte)0x4C});
 168  1
     registerCodes('\u0063', new byte[]{(byte)0x4D});
 169  1
     registerCodes('\u0064', new byte[]{(byte)0x4F});
 170  1
     registerCodes('\u0065', new byte[]{(byte)0x51});
 171  1
     registerCodes('\u0066', new byte[]{(byte)0x53});
 172  1
     registerCodes('\u0067', new byte[]{(byte)0x55});
 173  1
     registerCodes('\u0068', new byte[]{(byte)0x57});
 174  1
     registerCodes('\u0069', new byte[]{(byte)0x59});
 175  1
     registerCodes('\u006A', new byte[]{(byte)0x5B});
 176  1
     registerCodes('\u006B', new byte[]{(byte)0x5C});
 177  1
     registerCodes('\u006C', new byte[]{(byte)0x5E});
 178  1
     registerCodes('\u006D', new byte[]{(byte)0x60});
 179  1
     registerCodes('\u006E', new byte[]{(byte)0x62});
 180  1
     registerCodes('\u006F', new byte[]{(byte)0x64});
 181  1
     registerCodes('\u0070', new byte[]{(byte)0x66});
 182  1
     registerCodes('\u0071', new byte[]{(byte)0x68});
 183  1
     registerCodes('\u0072', new byte[]{(byte)0x69});
 184  1
     registerCodes('\u0073', new byte[]{(byte)0x6B});
 185  1
     registerCodes('\u0074', new byte[]{(byte)0x6D});
 186  1
     registerCodes('\u0075', new byte[]{(byte)0x6F});
 187  1
     registerCodes('\u0076', new byte[]{(byte)0x71});
 188  1
     registerCodes('\u0077', new byte[]{(byte)0x73});
 189  1
     registerCodes('\u0078', new byte[]{(byte)0x75});
 190  1
     registerCodes('\u0079', new byte[]{(byte)0x76});
 191  1
     registerCodes('\u007A', new byte[]{(byte)0x78});
 192  1
     registerCodes('\u007B', new byte[]{(byte)0x2B, (byte)0x09});
 193  1
     registerCodes('\u007C', new byte[]{(byte)0x2B, (byte)0x0B});
 194  1
     registerCodes('\u007D', new byte[]{(byte)0x2B, (byte)0x0D});
 195  1
     registerCodes('\u007E', new byte[]{(byte)0x2B, (byte)0x0F});
 196  1
     registerCodes('\u00A0', new byte[]{(byte)0x08, (byte)0x02});
 197  1
     registerCodes('\u00A1', new byte[]{(byte)0x2B, (byte)0x10});
 198  1
     registerCodes('\u00A2', new byte[]{(byte)0x34, (byte)0xA6});
 199  1
     registerCodes('\u00A3', new byte[]{(byte)0x34, (byte)0xA7});
 200  1
     registerCodes('\u00A4', new byte[]{(byte)0x34, (byte)0xA8});
 201  1
     registerCodes('\u00A5', new byte[]{(byte)0x34, (byte)0xA9});
 202  1
     registerCodes('\u00A6', new byte[]{(byte)0x2B, (byte)0x11});
 203  1
     registerCodes('\u00A7', new byte[]{(byte)0x34, (byte)0xAA});
 204  1
     registerCodes('\u00A8', new byte[]{(byte)0x2B, (byte)0x12});
 205  1
     registerCodes('\u00A9', new byte[]{(byte)0x34, (byte)0xAB});
 206  1
     registerCodes('\u00AB', new byte[]{(byte)0x33, (byte)0x05});
 207  1
     registerCodes('\u00AC', new byte[]{(byte)0x34, (byte)0xAC});
 208  1
     registerCodes('\u00AE', new byte[]{(byte)0x34, (byte)0xAD});
 209  1
     registerCodes('\u00AF', new byte[]{(byte)0x2B, (byte)0x13});
 210  1
     registerCodes('\u00B0', new byte[]{(byte)0x34, (byte)0xAE});
 211  1
     registerCodes('\u00B1', new byte[]{(byte)0x33, (byte)0x04});
 212  1
     registerCodes('\u00B2', new byte[]{(byte)0x3A});
 213  1
     registerCodes('\u00B3', new byte[]{(byte)0x3C});
 214  1
     registerCodes('\u00B4', new byte[]{(byte)0x2B, (byte)0x14});
 215  1
     registerCodes('\u00B5', new byte[]{(byte)0x34, (byte)0xAF});
 216  1
     registerCodes('\u00B6', new byte[]{(byte)0x34, (byte)0xB0});
 217  1
     registerCodes('\u00B7', new byte[]{(byte)0x34, (byte)0xB1});
 218  1
     registerCodes('\u00B8', new byte[]{(byte)0x2B, (byte)0x15});
 219  1
     registerCodes('\u00B9', new byte[]{(byte)0x38});
 220  1
     registerCodes('\u00BB', new byte[]{(byte)0x33, (byte)0x07});
 221  1
     registerCodes('\u00BC', new byte[]{(byte)0x37, (byte)0x12});
 222  1
     registerCodes('\u00BD', new byte[]{(byte)0x37, (byte)0x16});
 223  1
     registerCodes('\u00BE', new byte[]{(byte)0x37, (byte)0x1A});
 224  1
     registerCodes('\u00BF', new byte[]{(byte)0x2B, (byte)0x16});
 225  1
     registerCodes('\u00C6', new byte[]{(byte)0x4A, (byte)0x51});
 226  1
     registerCodes('\u00D7', new byte[]{(byte)0x33, (byte)0x09});
 227  1
     registerCodes('\u00DE', new byte[]{(byte)0x6D, (byte)0x57});
 228  1
     registerCodes('\u00DF', new byte[]{(byte)0x6B, (byte)0x6B});
 229  1
     registerCodes('\u00E6', new byte[]{(byte)0x4A, (byte)0x51});
 230  1
     registerCodes('\u00F7', new byte[]{(byte)0x33, (byte)0x0A});
 231  1
     registerCodes('\u00FE', new byte[]{(byte)0x6D, (byte)0x57});
 232  
 
 233  1
     registerUnprintableCodes('\u0001', new byte[]{(byte)0x03});
 234  1
     registerUnprintableCodes('\u0002', new byte[]{(byte)0x04});
 235  1
     registerUnprintableCodes('\u0003', new byte[]{(byte)0x05});
 236  1
     registerUnprintableCodes('\u0004', new byte[]{(byte)0x06});
 237  1
     registerUnprintableCodes('\u0005', new byte[]{(byte)0x07});
 238  1
     registerUnprintableCodes('\u0006', new byte[]{(byte)0x08});
 239  1
     registerUnprintableCodes('\u0007', new byte[]{(byte)0x09});
 240  1
     registerUnprintableCodes('\b',     new byte[]{(byte)0x0A});
 241  1
     registerUnprintableCodes('\u000E', new byte[]{(byte)0x0B});
 242  1
     registerUnprintableCodes('\u000F', new byte[]{(byte)0x0C});
 243  1
     registerUnprintableCodes('\u0010', new byte[]{(byte)0x0D});
 244  1
     registerUnprintableCodes('\u0011', new byte[]{(byte)0x0E});
 245  1
     registerUnprintableCodes('\u0012', new byte[]{(byte)0x0F});
 246  1
     registerUnprintableCodes('\u0013', new byte[]{(byte)0x10});
 247  1
     registerUnprintableCodes('\u0014', new byte[]{(byte)0x11});
 248  1
     registerUnprintableCodes('\u0015', new byte[]{(byte)0x12});
 249  1
     registerUnprintableCodes('\u0016', new byte[]{(byte)0x13});
 250  1
     registerUnprintableCodes('\u0017', new byte[]{(byte)0x14});
 251  1
     registerUnprintableCodes('\u0018', new byte[]{(byte)0x15});
 252  1
     registerUnprintableCodes('\u0019', new byte[]{(byte)0x16});
 253  1
     registerUnprintableCodes('\u001A', new byte[]{(byte)0x17});
 254  1
     registerUnprintableCodes('\u001B', new byte[]{(byte)0x18});
 255  1
     registerUnprintableCodes('\u001C', new byte[]{(byte)0x19});
 256  1
     registerUnprintableCodes('\u001D', new byte[]{(byte)0x1A});
 257  1
     registerUnprintableCodes('\u001E', new byte[]{(byte)0x1B});
 258  1
     registerUnprintableCodes('\u001F', new byte[]{(byte)0x1C});
 259  1
     registerUnprintableCodes('\'',     new byte[]{(byte)0x80});
 260  1
     registerUnprintableCodes('\u002D', new byte[]{(byte)0x82});
 261  1
     registerUnprintableCodes('\u007F', new byte[]{(byte)0x1D});
 262  1
     registerUnprintableCodes('\u0080', new byte[]{(byte)0x1E});
 263  1
     registerUnprintableCodes('\u0081', new byte[]{(byte)0x1F});
 264  1
     registerUnprintableCodes('\u0082', new byte[]{(byte)0x20});
 265  1
     registerUnprintableCodes('\u0083', new byte[]{(byte)0x21});
 266  1
     registerUnprintableCodes('\u0084', new byte[]{(byte)0x22});
 267  1
     registerUnprintableCodes('\u0085', new byte[]{(byte)0x23});
 268  1
     registerUnprintableCodes('\u0086', new byte[]{(byte)0x24});
 269  1
     registerUnprintableCodes('\u0087', new byte[]{(byte)0x25});
 270  1
     registerUnprintableCodes('\u0088', new byte[]{(byte)0x26});
 271  1
     registerUnprintableCodes('\u0089', new byte[]{(byte)0x27});
 272  1
     registerUnprintableCodes('\u008A', new byte[]{(byte)0x28});
 273  1
     registerUnprintableCodes('\u008B', new byte[]{(byte)0x29});
 274  1
     registerUnprintableCodes('\u008C', new byte[]{(byte)0x2A});
 275  1
     registerUnprintableCodes('\u008D', new byte[]{(byte)0x2B});
 276  1
     registerUnprintableCodes('\u008E', new byte[]{(byte)0x2C});
 277  1
     registerUnprintableCodes('\u008F', new byte[]{(byte)0x2D});
 278  1
     registerUnprintableCodes('\u0090', new byte[]{(byte)0x2E});
 279  1
     registerUnprintableCodes('\u0091', new byte[]{(byte)0x2F});
 280  1
     registerUnprintableCodes('\u0092', new byte[]{(byte)0x30});
 281  1
     registerUnprintableCodes('\u0093', new byte[]{(byte)0x31});
 282  1
     registerUnprintableCodes('\u0094', new byte[]{(byte)0x32});
 283  1
     registerUnprintableCodes('\u0095', new byte[]{(byte)0x33});
 284  1
     registerUnprintableCodes('\u0096', new byte[]{(byte)0x34});
 285  1
     registerUnprintableCodes('\u0097', new byte[]{(byte)0x35});
 286  1
     registerUnprintableCodes('\u0098', new byte[]{(byte)0x36});
 287  1
     registerUnprintableCodes('\u0099', new byte[]{(byte)0x37});
 288  1
     registerUnprintableCodes('\u009A', new byte[]{(byte)0x38});
 289  1
     registerUnprintableCodes('\u009B', new byte[]{(byte)0x39});
 290  1
     registerUnprintableCodes('\u009C', new byte[]{(byte)0x3A});
 291  1
     registerUnprintableCodes('\u009D', new byte[]{(byte)0x3B});
 292  1
     registerUnprintableCodes('\u009E', new byte[]{(byte)0x3C});
 293  1
     registerUnprintableCodes('\u009F', new byte[]{(byte)0x3D});
 294  1
     registerUnprintableCodes('\u00AD', new byte[]{(byte)0x83});
 295  
 
 296  1
     registerInternationalCodes('\u00AA', new byte[]{(byte)0x4A},
 297  
                                new byte[]{(byte)0x03});
 298  1
     registerInternationalCodes('\u00BA', new byte[]{(byte)0x64},
 299  
                                new byte[]{(byte)0x03});
 300  1
     registerInternationalCodes('\u00C0', new byte[]{(byte)0x4A},
 301  
                                new byte[]{(byte)0x0F});
 302  1
     registerInternationalCodes('\u00C1', new byte[]{(byte)0x4A},
 303  
                                new byte[]{(byte)0x0E});
 304  1
     registerInternationalCodes('\u00C2', new byte[]{(byte)0x4A},
 305  
                                new byte[]{(byte)0x12});
 306  1
     registerInternationalCodes('\u00C3', new byte[]{(byte)0x4A},
 307  
                                new byte[]{(byte)0x19});
 308  1
     registerInternationalCodes('\u00C4', new byte[]{(byte)0x4A},
 309  
                                new byte[]{(byte)0x13});
 310  1
     registerInternationalCodes('\u00C5', new byte[]{(byte)0x4A},
 311  
                                new byte[]{(byte)0x1A});
 312  1
     registerInternationalCodes('\u00C7', new byte[]{(byte)0x4D},
 313  
                                new byte[]{(byte)0x1C});
 314  1
     registerInternationalCodes('\u00C8', new byte[]{(byte)0x51},
 315  
                                new byte[]{(byte)0x0F});
 316  1
     registerInternationalCodes('\u00C9', new byte[]{(byte)0x51},
 317  
                                new byte[]{(byte)0x0E});
 318  1
     registerInternationalCodes('\u00CA', new byte[]{(byte)0x51},
 319  
                                new byte[]{(byte)0x12});
 320  1
     registerInternationalCodes('\u00CB', new byte[]{(byte)0x51},
 321  
                                new byte[]{(byte)0x13});
 322  1
     registerInternationalCodes('\u00CC', new byte[]{(byte)0x59},
 323  
                                new byte[]{(byte)0x0F});
 324  1
     registerInternationalCodes('\u00CD', new byte[]{(byte)0x59},
 325  
                                new byte[]{(byte)0x0E});
 326  1
     registerInternationalCodes('\u00CE', new byte[]{(byte)0x59},
 327  
                                new byte[]{(byte)0x12});
 328  1
     registerInternationalCodes('\u00CF', new byte[]{(byte)0x59},
 329  
                                new byte[]{(byte)0x13});
 330  1
     registerInternationalCodes('\u00D0', new byte[]{(byte)0x4F},
 331  
                                new byte[]{(byte)0x68});
 332  1
     registerInternationalCodes('\u00D1', new byte[]{(byte)0x62},
 333  
                                new byte[]{(byte)0x19});
 334  1
     registerInternationalCodes('\u00D2', new byte[]{(byte)0x64},
 335  
                                new byte[]{(byte)0x0F});
 336  1
     registerInternationalCodes('\u00D3', new byte[]{(byte)0x64},
 337  
                                new byte[]{(byte)0x0E});
 338  1
     registerInternationalCodes('\u00D4', new byte[]{(byte)0x64},
 339  
                                new byte[]{(byte)0x12});
 340  1
     registerInternationalCodes('\u00D5', new byte[]{(byte)0x64},
 341  
                                new byte[]{(byte)0x19});
 342  1
     registerInternationalCodes('\u00D6', new byte[]{(byte)0x64},
 343  
                                new byte[]{(byte)0x13});
 344  1
     registerInternationalCodes('\u00D8', new byte[]{(byte)0x64},
 345  
                                new byte[]{(byte)0x21});
 346  1
     registerInternationalCodes('\u00D9', new byte[]{(byte)0x6F},
 347  
                                new byte[]{(byte)0x0F});
 348  1
     registerInternationalCodes('\u00DA', new byte[]{(byte)0x6F},
 349  
                                new byte[]{(byte)0x0E});
 350  1
     registerInternationalCodes('\u00DB', new byte[]{(byte)0x6F},
 351  
                                new byte[]{(byte)0x12});
 352  1
     registerInternationalCodes('\u00DC', new byte[]{(byte)0x6F},
 353  
                                new byte[]{(byte)0x13});
 354  1
     registerInternationalCodes('\u00DD', new byte[]{(byte)0x76},
 355  
                                new byte[]{(byte)0x0E});
 356  1
     registerInternationalCodes('\u00E0', new byte[]{(byte)0x4A},
 357  
                                new byte[]{(byte)0x0F});
 358  1
     registerInternationalCodes('\u00E1', new byte[]{(byte)0x4A},
 359  
                                new byte[]{(byte)0x0E});
 360  1
     registerInternationalCodes('\u00E2', new byte[]{(byte)0x4A},
 361  
                                new byte[]{(byte)0x12});
 362  1
     registerInternationalCodes('\u00E3', new byte[]{(byte)0x4A},
 363  
                                new byte[]{(byte)0x19});
 364  1
     registerInternationalCodes('\u00E4', new byte[]{(byte)0x4A},
 365  
                                new byte[]{(byte)0x13});
 366  1
     registerInternationalCodes('\u00E5', new byte[]{(byte)0x4A},
 367  
                                new byte[]{(byte)0x1A});
 368  1
     registerInternationalCodes('\u00E7', new byte[]{(byte)0x4D},
 369  
                                new byte[]{(byte)0x1C});
 370  1
     registerInternationalCodes('\u00E8', new byte[]{(byte)0x51},
 371  
                                new byte[]{(byte)0x0F});
 372  1
     registerInternationalCodes('\u00E9', new byte[]{(byte)0x51},
 373  
                                new byte[]{(byte)0x0E});
 374  1
     registerInternationalCodes('\u00EA', new byte[]{(byte)0x51},
 375  
                                new byte[]{(byte)0x12});
 376  1
     registerInternationalCodes('\u00EB', new byte[]{(byte)0x51},
 377  
                                new byte[]{(byte)0x13});
 378  1
     registerInternationalCodes('\u00EC', new byte[]{(byte)0x59},
 379  
                                new byte[]{(byte)0x0F});
 380  1
     registerInternationalCodes('\u00ED', new byte[]{(byte)0x59},
 381  
                                new byte[]{(byte)0x0E});
 382  1
     registerInternationalCodes('\u00EE', new byte[]{(byte)0x59},
 383  
                                new byte[]{(byte)0x12});
 384  1
     registerInternationalCodes('\u00EF', new byte[]{(byte)0x59},
 385  
                                new byte[]{(byte)0x13});
 386  1
     registerInternationalCodes('\u00F0', new byte[]{(byte)0x4F},
 387  
                                new byte[]{(byte)0x68});
 388  1
     registerInternationalCodes('\u00F1', new byte[]{(byte)0x62},
 389  
                                new byte[]{(byte)0x19});
 390  1
     registerInternationalCodes('\u00F2', new byte[]{(byte)0x64},
 391  
                                new byte[]{(byte)0x0F});
 392  1
     registerInternationalCodes('\u00F3', new byte[]{(byte)0x64},
 393  
                                new byte[]{(byte)0x0E});
 394  1
     registerInternationalCodes('\u00F4', new byte[]{(byte)0x64},
 395  
                                new byte[]{(byte)0x12});
 396  1
     registerInternationalCodes('\u00F5', new byte[]{(byte)0x64},
 397  
                                new byte[]{(byte)0x19});
 398  1
     registerInternationalCodes('\u00F6', new byte[]{(byte)0x64},
 399  
                                new byte[]{(byte)0x13});
 400  1
     registerInternationalCodes('\u00F8', new byte[]{(byte)0x64},
 401  
                                new byte[]{(byte)0x21});
 402  1
     registerInternationalCodes('\u00F9', new byte[]{(byte)0x6F},
 403  
                                new byte[]{(byte)0x0F});
 404  1
     registerInternationalCodes('\u00FA', new byte[]{(byte)0x6F},
 405  
                                new byte[]{(byte)0x0E});
 406  1
     registerInternationalCodes('\u00FB', new byte[]{(byte)0x6F},
 407  
                                new byte[]{(byte)0x12});
 408  1
     registerInternationalCodes('\u00FC', new byte[]{(byte)0x6F},
 409  
                                new byte[]{(byte)0x13});
 410  1
     registerInternationalCodes('\u00FD', new byte[]{(byte)0x76},
 411  
                                new byte[]{(byte)0x0E});
 412  1
     registerInternationalCodes('\u00FF', new byte[]{(byte)0x76},
 413  
                                new byte[]{(byte)0x13});
 414  
     
 415  1
   }
 416  
 
 417  
   
 418  0
   private IndexCodes() {
 419  0
   }
 420  
 
 421  
   private static void registerCodes(char c, byte[] codes) {
 422  135
     CODES.put(c, codes);
 423  135
   }
 424  
   
 425  
   private static void registerUnprintableCodes(char c, byte[] codes) {
 426  62
     UNPRINTABLE_CODES.put(c, codes);
 427  62
   }
 428  
   
 429  
   private static void registerInternationalCodes(
 430  
       char c, byte[] inlineCodes, byte[] extraCodes) {
 431  59
     INTERNATIONAL_CODES.put(c,
 432  
                             new InternationalCodes(inlineCodes, extraCodes));
 433  59
   }
 434  
   
 435  
   static boolean isNullEntry(byte startEntryFlag) {
 436  0
     return((startEntryFlag == ASC_NULL_FLAG) ||
 437  
            (startEntryFlag == DESC_NULL_FLAG));
 438  
   }
 439  
   
 440  
   static byte getNullEntryFlag(boolean isAscending) {
 441  2150
     return(isAscending ? ASC_NULL_FLAG : DESC_NULL_FLAG);
 442  
   }
 443  
   
 444  
   static byte getStartEntryFlag(boolean isAscending) {
 445  4423
     return(isAscending ? ASC_START_FLAG : DESC_START_FLAG);
 446  
   }
 447  
   
 448  59
   static final class InternationalCodes {
 449  
     public final byte[] _inlineCodes;
 450  
     public final byte[] _extraCodes;
 451  
 
 452  59
     private InternationalCodes(byte[] inlineCodes, byte[] extraCodes) {
 453  59
       _inlineCodes = inlineCodes;
 454  59
       _extraCodes = extraCodes;
 455  59