325N/A * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * (C) Copyright Taligent, Inc. 1996 - All Rights Reserved 325N/A * (C) Copyright IBM Corp. 1996 - All Rights Reserved 325N/A * The original version of this source code and documentation is copyrighted 325N/A * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These 325N/A * materials are provided under terms of a License Agreement between Taligent 325N/A * and Sun. This technology is protected by multiple US and International 325N/A * patents. This notice and attribution to Taligent may not be removed. 325N/A * Taligent is a registered trademark of Taligent, Inc. 325N/A * class CompactATypeArray : use only on primitive data types 325N/A * Provides a compact way to store information that is indexed by Unicode 325N/A * values, such as character properties, types, keyboard values, etc.This 325N/A * is very useful when you have a block of Unicode data that contains 325N/A * significant values while the rest of the Unicode data is unused in the 325N/A * application or when you have a lot of redundance, such as where all 21,000 325N/A * Han ideographs have the same value. However, lookup is much faster than a 325N/A * A compact array of any primitive data type serves two purposes: 325N/A * <LI>Fast access of the indexed values. 325N/A * <LI>Smaller memory footprint. 325N/A * A compact array is composed of a index array and value array. The index 325N/A * array contains the indicies of Unicode characters to the value array. 325N/A * @see CompactShortArray 325N/A * The total number of Unicode characters. 325N/A * Constructor for CompactByteArray. 325N/A * @param defaultValue the default value of the compact array. 325N/A * Constructor for CompactByteArray. 325N/A * @param indexArray the indicies of the compact array. 325N/A * @param newValues the values of the compact array. 325N/A * @exception IllegalArgumentException If index is out of range. 325N/A * Get the mapped value of a Unicode character. 325N/A * @param index the character to get the mapped value with 325N/A * @return the mapped value of the given character 325N/A * Set a new value for a Unicode character. 325N/A * Set automatically expands the array if it is compacted. 325N/A * @param index the character to set the mapped value with 325N/A * @param value the new mapped value 325N/A * Set new values for a range of Unicode character. 325N/A * @param start the starting offset o of the range 325N/A * @param end the ending offset of the range 325N/A * @param value the new mapped value 325N/A // If no values in this block were set, we can just set its 325N/A // index to be the same as some other block with no values 325N/A // set, assuming we've seen one yet. 325N/A // we didn't match, so copy & update 325N/A // If this is the first untouched block we've seen, 325N/A // we are done compacting, so now make the array shorter 325N/A * Convenience utility to compare two arrays of doubles. 325N/A * @param len the length to compare. 325N/A * The start indices and start+len must be valid. 325N/A * Remember that a specified block was "touched", i.e. had a value set. 325N/A * Untouched blocks can be skipped when compacting the array 325N/A * Query whether a specified block was "touched", i.e. had a value set. 325N/A * Untouched blocks can be skipped when compacting the array 325N/A /** For internal use only. Do not modify the result, the behavior of 325N/A * modified results are undefined. 325N/A /** For internal use only. Do not modify the result, the behavior of 325N/A * modified results are undefined. 325N/A * Compares the equality of two compact array objects. 325N/A * @param obj the compact array object to be compared with this. 325N/A * @return true if the current compact array object is the same 325N/A * as the compact array object obj; false otherwise. 325N/A // could be sped up later 325N/A return true;
// we made it through the guantlet. 325N/A * Generates the hash code for the compact array object 325N/A // -------------------------------------------------------------- 325N/A // -------------------------------------------------------------- 325N/A * Expanding takes the array back to a 65536 element array. 325N/A private byte[]
values;
// char -> short (char parameterized short)