001: /*
002: * CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF
003: * NETSCAPE COMMUNICATIONS CORPORATION
004: *
005: * Copyright (c) 1996 Netscape Communications Corporation.
006: * All Rights Reserved.
007: * Use of this Source Code is subject to the terms of the applicable
008: * license agreement from Netscape Communications Corporation.
009: */
010:
011: package util;
012:
013: import java.util.Hashtable;
014:
015: /**
016: * A little piece of excess that defines constants for keys.
017: */
018: public class Key {
019: /**
020: * Return is a 10!
021: */
022: public final static int RETURN = 10;
023:
024: /**
025: * Control H is a 8!
026: */
027: public final static int CTRLH = 8;
028:
029: /**
030: * Control J is a 10!
031: */
032: public final static int CTRLJ = 10;
033:
034: /**
035: * Control K is a 11!
036: */
037: public final static int CTRLK = 11;
038:
039: /**
040: * Control L is a 12!
041: */
042: public final static int CTRLL = 12;
043:
044: /**
045: * Del is a 127!
046: */
047: public final static int DEL = 127;
048:
049: /*------------------------------------------------------------*/
050:
051: /**
052: * Total alphanumerics.
053: */
054: public final static int ALPHANUMERIC_COUNT = 62;
055:
056: /**
057: * Returns a Hashtable of alphanumeric characters.
058: */
059: public static Hashtable alphanumerics() {
060: return alphanumerics(ALPHANUMERIC_COUNT);
061: }
062:
063: /**
064: * Returns a Hashtable of alphanumeric characters.
065: * @param n number of slots to allocate in the hashtable.
066: */
067: public static Hashtable alphanumerics(int n) {
068: Hashtable hashTable = new Hashtable(n);
069:
070: hashTable.put(new Integer(48), new Character('0'));
071: hashTable.put(new Integer(49), new Character('1'));
072: hashTable.put(new Integer(50), new Character('2'));
073: hashTable.put(new Integer(51), new Character('3'));
074: hashTable.put(new Integer(52), new Character('4'));
075: hashTable.put(new Integer(53), new Character('5'));
076: hashTable.put(new Integer(54), new Character('6'));
077: hashTable.put(new Integer(55), new Character('7'));
078: hashTable.put(new Integer(56), new Character('8'));
079: hashTable.put(new Integer(57), new Character('9'));
080: hashTable.put(new Integer(65), new Character('A'));
081: hashTable.put(new Integer(66), new Character('B'));
082: hashTable.put(new Integer(67), new Character('C'));
083: hashTable.put(new Integer(68), new Character('D'));
084: hashTable.put(new Integer(69), new Character('E'));
085: hashTable.put(new Integer(70), new Character('F'));
086: hashTable.put(new Integer(71), new Character('G'));
087: hashTable.put(new Integer(72), new Character('H'));
088: hashTable.put(new Integer(73), new Character('I'));
089: hashTable.put(new Integer(74), new Character('J'));
090: hashTable.put(new Integer(75), new Character('K'));
091: hashTable.put(new Integer(76), new Character('L'));
092: hashTable.put(new Integer(77), new Character('M'));
093: hashTable.put(new Integer(78), new Character('N'));
094: hashTable.put(new Integer(79), new Character('O'));
095: hashTable.put(new Integer(80), new Character('P'));
096: hashTable.put(new Integer(81), new Character('Q'));
097: hashTable.put(new Integer(82), new Character('R'));
098: hashTable.put(new Integer(83), new Character('S'));
099: hashTable.put(new Integer(84), new Character('T'));
100: hashTable.put(new Integer(85), new Character('U'));
101: hashTable.put(new Integer(86), new Character('V'));
102: hashTable.put(new Integer(87), new Character('W'));
103: hashTable.put(new Integer(88), new Character('X'));
104: hashTable.put(new Integer(89), new Character('Y'));
105: hashTable.put(new Integer(90), new Character('Z'));
106: hashTable.put(new Integer(97), new Character('a'));
107: hashTable.put(new Integer(98), new Character('b'));
108: hashTable.put(new Integer(99), new Character('c'));
109: hashTable.put(new Integer(100), new Character('d'));
110: hashTable.put(new Integer(101), new Character('e'));
111: hashTable.put(new Integer(102), new Character('f'));
112: hashTable.put(new Integer(103), new Character('g'));
113: hashTable.put(new Integer(104), new Character('h'));
114: hashTable.put(new Integer(105), new Character('i'));
115: hashTable.put(new Integer(106), new Character('j'));
116: hashTable.put(new Integer(107), new Character('k'));
117: hashTable.put(new Integer(108), new Character('l'));
118: hashTable.put(new Integer(109), new Character('m'));
119: hashTable.put(new Integer(110), new Character('n'));
120: hashTable.put(new Integer(111), new Character('o'));
121: hashTable.put(new Integer(112), new Character('p'));
122: hashTable.put(new Integer(113), new Character('q'));
123: hashTable.put(new Integer(114), new Character('r'));
124: hashTable.put(new Integer(115), new Character('s'));
125: hashTable.put(new Integer(116), new Character('t'));
126: hashTable.put(new Integer(117), new Character('u'));
127: hashTable.put(new Integer(118), new Character('v'));
128: hashTable.put(new Integer(119), new Character('w'));
129: hashTable.put(new Integer(120), new Character('x'));
130: hashTable.put(new Integer(121), new Character('y'));
131: hashTable.put(new Integer(122), new Character('z'));
132:
133: return hashTable;
134: }
135:
136: /*------------------------------------------------------------*/
137:
138: /**
139: * Total i18n alphanumerics.
140: */
141: public final static int I18NALPHANUMERIC_COUNT = 156;
142:
143: /**
144: * Returns a Hashtable of i18n alphanumeric characters.
145: */
146: public static Hashtable i18nalphanumerics() {
147: return alphanumerics(ALPHANUMERIC_COUNT);
148: }
149:
150: /**
151: * Returns a Hashtable of i18n alphanumeric characters.
152: * @param n number of slots to allocate in the hashtable.
153: */
154: public static Hashtable i18nalphanumerics(int n) {
155: // grab the normal chars...
156: Hashtable hashTable = alphanumerics(n);
157:
158: // ...and add the i18n chars - use 0s (!)
159: hashTable.put(new Integer(161), new Character('0'));
160: hashTable.put(new Integer(162), new Character('0'));
161: hashTable.put(new Integer(163), new Character('0'));
162: hashTable.put(new Integer(164), new Character('0'));
163: hashTable.put(new Integer(165), new Character('0'));
164: hashTable.put(new Integer(166), new Character('0'));
165: hashTable.put(new Integer(167), new Character('0'));
166: hashTable.put(new Integer(168), new Character('0'));
167: hashTable.put(new Integer(169), new Character('0'));
168: hashTable.put(new Integer(170), new Character('0'));
169: hashTable.put(new Integer(171), new Character('0'));
170: hashTable.put(new Integer(172), new Character('0'));
171: hashTable.put(new Integer(173), new Character('0'));
172: hashTable.put(new Integer(174), new Character('0'));
173: hashTable.put(new Integer(175), new Character('0'));
174: hashTable.put(new Integer(176), new Character('0'));
175: hashTable.put(new Integer(177), new Character('0'));
176: hashTable.put(new Integer(178), new Character('0'));
177: hashTable.put(new Integer(179), new Character('0'));
178: hashTable.put(new Integer(180), new Character('0'));
179: hashTable.put(new Integer(181), new Character('0'));
180: hashTable.put(new Integer(182), new Character('0'));
181: hashTable.put(new Integer(183), new Character('0'));
182: hashTable.put(new Integer(184), new Character('0'));
183: hashTable.put(new Integer(185), new Character('0'));
184: hashTable.put(new Integer(186), new Character('0'));
185: hashTable.put(new Integer(187), new Character('0'));
186: hashTable.put(new Integer(188), new Character('0'));
187: hashTable.put(new Integer(189), new Character('0'));
188: hashTable.put(new Integer(190), new Character('0'));
189: hashTable.put(new Integer(191), new Character('0'));
190: hashTable.put(new Integer(192), new Character('0'));
191: hashTable.put(new Integer(193), new Character('0'));
192: hashTable.put(new Integer(194), new Character('0'));
193: hashTable.put(new Integer(195), new Character('0'));
194: hashTable.put(new Integer(196), new Character('0'));
195: hashTable.put(new Integer(197), new Character('0'));
196: hashTable.put(new Integer(198), new Character('0'));
197: hashTable.put(new Integer(199), new Character('0'));
198: hashTable.put(new Integer(200), new Character('0'));
199: hashTable.put(new Integer(201), new Character('0'));
200: hashTable.put(new Integer(202), new Character('0'));
201: hashTable.put(new Integer(203), new Character('0'));
202: hashTable.put(new Integer(204), new Character('0'));
203: hashTable.put(new Integer(205), new Character('0'));
204: hashTable.put(new Integer(206), new Character('0'));
205: hashTable.put(new Integer(207), new Character('0'));
206: hashTable.put(new Integer(208), new Character('0'));
207: hashTable.put(new Integer(209), new Character('0'));
208: hashTable.put(new Integer(210), new Character('0'));
209: hashTable.put(new Integer(211), new Character('0'));
210: hashTable.put(new Integer(212), new Character('0'));
211: hashTable.put(new Integer(213), new Character('0'));
212: hashTable.put(new Integer(214), new Character('0'));
213: hashTable.put(new Integer(215), new Character('0'));
214: hashTable.put(new Integer(216), new Character('0'));
215: hashTable.put(new Integer(217), new Character('0'));
216: hashTable.put(new Integer(218), new Character('0'));
217: hashTable.put(new Integer(219), new Character('0'));
218: hashTable.put(new Integer(220), new Character('0'));
219: hashTable.put(new Integer(221), new Character('0'));
220: hashTable.put(new Integer(222), new Character('0'));
221: hashTable.put(new Integer(223), new Character('0'));
222: hashTable.put(new Integer(224), new Character('0'));
223: hashTable.put(new Integer(225), new Character('0'));
224: hashTable.put(new Integer(226), new Character('0'));
225: hashTable.put(new Integer(227), new Character('0'));
226: hashTable.put(new Integer(228), new Character('0'));
227: hashTable.put(new Integer(229), new Character('0'));
228: hashTable.put(new Integer(230), new Character('0'));
229: hashTable.put(new Integer(231), new Character('0'));
230: hashTable.put(new Integer(232), new Character('0'));
231: hashTable.put(new Integer(233), new Character('0'));
232: hashTable.put(new Integer(234), new Character('0'));
233: hashTable.put(new Integer(235), new Character('0'));
234: hashTable.put(new Integer(236), new Character('0'));
235: hashTable.put(new Integer(237), new Character('0'));
236: hashTable.put(new Integer(238), new Character('0'));
237: hashTable.put(new Integer(239), new Character('0'));
238: hashTable.put(new Integer(240), new Character('0'));
239: hashTable.put(new Integer(241), new Character('0'));
240: hashTable.put(new Integer(242), new Character('0'));
241: hashTable.put(new Integer(243), new Character('0'));
242: hashTable.put(new Integer(244), new Character('0'));
243: hashTable.put(new Integer(245), new Character('0'));
244: hashTable.put(new Integer(246), new Character('0'));
245: hashTable.put(new Integer(247), new Character('0'));
246: hashTable.put(new Integer(248), new Character('0'));
247: hashTable.put(new Integer(249), new Character('0'));
248: hashTable.put(new Integer(250), new Character('0'));
249: hashTable.put(new Integer(251), new Character('0'));
250: hashTable.put(new Integer(252), new Character('0'));
251: hashTable.put(new Integer(253), new Character('0'));
252: hashTable.put(new Integer(254), new Character('0'));
253: hashTable.put(new Integer(255), new Character('0'));
254:
255: return hashTable;
256: }
257: }
|