< prev index next >

jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 20,39 **** * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! ******************************************************************************* ! * (C) Copyright IBM Corp. and others, 1996-2009 - All Rights Reserved * ! * * ! * The original version of this source code and documentation is copyrighted * ! * and owned by IBM, These materials are provided under terms of a License * ! * Agreement between IBM and Sun. This technology is protected by multiple * ! * US and International patents. This notice and attribution to IBM may not * ! * to removed. * ! ******************************************************************************* */ package sun.text.normalizer; import java.io.DataInputStream; --- 20,35 ---- * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ + /* ! ****************************************************************************** ! * Copyright (C) 1996-2014, International Business Machines Corporation and ! * others. All Rights Reserved. ! ****************************************************************************** */ package sun.text.normalizer; import java.io.DataInputStream;
*** 133,163 **** m_dataOffset_ = input.readInt(); m_dataLength_ = input.readInt(); unserialize(inputStream); } - /** - * Trie constructor - * @param index array to be used for index - * @param options used by the trie - * @param dataManipulate object containing the information to parse the - * trie data - */ - protected Trie(char index[], int options, DataManipulate dataManipulate) - { - m_options_ = options; - if(dataManipulate != null) { - m_dataManipulate_ = dataManipulate; - } else { - m_dataManipulate_ = new DefaultGetFoldingOffset(); - } - m_isLatin1Linear_ = (m_options_ & - HEADER_OPTIONS_LATIN1_IS_LINEAR_MASK_) != 0; - m_index_ = index; - m_dataOffset_ = m_index_.length; - } - // protected data members ------------------------------------------ /** * Lead surrogate code points' index displacement in the index array. * <pre>{@code --- 129,138 ----
*** 186,205 **** /** * Mask for getting the lower bits from the input index. * DATA_BLOCK_LENGTH - 1. */ protected static final int INDEX_STAGE_3_MASK_ = DATA_BLOCK_LENGTH - 1; - /** Number of bits of a trail surrogate that are used in index table lookups. */ - protected static final int SURROGATE_BLOCK_BITS=10-INDEX_STAGE_1_SHIFT_; - /** - * Number of index (stage 1) entries per lead surrogate. - * Same as number of index entries for 1024 trail surrogates, - * {@code ==0x400>>INDEX_STAGE_1_SHIFT_} - */ - protected static final int SURROGATE_BLOCK_COUNT=(1<<SURROGATE_BLOCK_BITS); - /** Length of the BMP portion of the index (stage 1) array. */ - protected static final int BMP_INDEX_LENGTH=0x10000>>INDEX_STAGE_1_SHIFT_; /** * Surrogate mask to use when shifting offset to retrieve supplementary * values */ protected static final int SURROGATE_MASK_ = 0x3FF; --- 161,170 ----
*** 233,255 **** * @return offset to data */ protected abstract int getSurrogateOffset(char lead, char trail); /** - * Gets the value at the argument index - * @param index value at index will be retrieved - * @return 32 bit value - */ - protected abstract int getValue(int index); - - /** - * Gets the default initial value - * @return 32 bit value - */ - protected abstract int getInitialValue(); - - /** * Gets the offset to the data which the index ch after variable offset * points to. * Note for locating a non-supplementary character data offset, calling * <p> * getRawOffset(0, ch); --- 198,207 ----
*** 319,329 **** // look at the construction of supplementary characters // trail forms the ends of it. return getSurrogateOffset(UTF16.getLeadSurrogate(ch), (char)(ch & SURROGATE_MASK_)); } else { ! // return -1 // if there is an error, in this case we return return -1; } } /** --- 271,281 ---- // look at the construction of supplementary characters // trail forms the ends of it. return getSurrogateOffset(UTF16.getLeadSurrogate(ch), (char)(ch & SURROGATE_MASK_)); } else { ! // return -1 if there is an error, in this case we return return -1; } } /**
*** 341,359 **** m_index_[i] = input.readChar(); } } /** - * Determines if this is a 32 bit trie - * @return true if options specifies this is a 32 bit trie - */ - protected final boolean isIntTrie() - { - return (m_options_ & HEADER_OPTIONS_DATA_IS_32_BIT_) != 0; - } - - /** * Determines if this is a 16 bit trie * @return true if this is a 16 bit trie */ protected final boolean isCharTrie() { --- 293,302 ----
< prev index next >