]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/impl/PVecToTrieCompactHandler.java
Added flags.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / impl / PVecToTrieCompactHandler.java
1 /*
2  ******************************************************************************
3  * Copyright (C) 1996-2009, International Business Machines Corporation and   *
4  * others. All Rights Reserved.                                               *
5  ******************************************************************************
6  */
7
8 /*
9  * @author Shaopeng Jia
10  */
11
12 package com.ibm.icu.impl;
13
14 import com.ibm.icu.impl.PropsVectors.CompactHandler;
15
16 public class PVecToTrieCompactHandler implements CompactHandler {
17     public IntTrieBuilder builder;
18     public int initialValue;
19
20     public void setRowIndexForErrorValue(int rowIndex) {
21     }
22
23     public void setRowIndexForInitialValue(int rowIndex) {
24         initialValue = rowIndex;
25     }
26
27     public void setRowIndexForRange(int start, int end, int rowIndex) {
28         builder.setRange(start, end + 1, rowIndex, true);
29     }
30
31     public void startRealValues(int rowIndex) {
32         if (rowIndex > 0xffff) {
33             // too many rows for a 16-bit trie
34             throw new IndexOutOfBoundsException();
35         } else {
36             builder = new IntTrieBuilder(null, 100000, initialValue,
37                     initialValue, false);
38         } 
39     }
40 }