亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? property.java

?? java 報表 to office文檔: 本包由java語言開發
?? JAVA
字號:
/* ====================================================================   Copyright 2002-2004   Apache Software Foundation   Licensed under the Apache License, Version 2.0 (the "License");   you may not use this file except in compliance with the License.   You may obtain a copy of the License at       http://www.apache.org/licenses/LICENSE-2.0   Unless required by applicable law or agreed to in writing, software   distributed under the License is distributed on an "AS IS" BASIS,   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the License for the specific language governing permissions and   limitations under the License.==================================================================== */        package org.apache.poi.hpsf;import java.io.UnsupportedEncodingException;import java.util.HashMap;import java.util.Map;import org.apache.poi.util.HexDump;import org.apache.poi.util.LittleEndian;/** * <p>A property in a {@link Section} of a {@link PropertySet}.</p> * * <p>The property's <strong>ID</strong> gives the property a meaning * in the context of its {@link Section}. Each {@link Section} spans * its own name space of property IDs.</p> * * <p>The property's <strong>type</strong> determines how its * <strong>value </strong> is interpreted. For example, if the type is * {@link Variant#VT_LPSTR} (byte string), the value consists of a * DWord telling how many bytes the string contains. The bytes follow * immediately, including any null bytes that terminate the * string. The type {@link Variant#VT_I4} denotes a four-byte integer * value, {@link Variant#VT_FILETIME} some date and time (of a * file).</p> * * <p>Please note that not all {@link Variant} types yet. This might change * over time but largely depends on your feedback so that the POI team knows * which variant types are really needed. So please feel free to submit error * reports or patches for the types you need.</p> *  * <p>Microsoft documentation: <a * href="http://msdn.microsoft.com/library/en-us/stg/stg/property_set_display_name_dictionary.asp?frame=true"> * Property Set Display Name Dictionary</a>. * * @author Rainer Klute <a * href="mailto:klute@rainer-klute.de">&lt;klute@rainer-klute.de&gt;</a> * @author Drew Varner (Drew.Varner InAndAround sc.edu) * @see Section * @see Variant * @version $Id: Property.java,v 1.21 2005/04/01 16:58:00 klute Exp $ * @since 2002-02-09 */public class Property{    /** <p>The property's ID.</p> */    protected long id;    /**     * <p>Returns the property's ID.</p>     *     * @return The ID value     */    public long getID()    {        return id;    }    /** <p>The property's type.</p> */    protected long type;    /**     * <p>Returns the property's type.</p>     *     * @return The type value     */    public long getType()    {        return type;    }    /** <p>The property's value.</p> */    protected Object value;    /**     * <p>Returns the property's value.</p>     *     * @return The property's value     */    public Object getValue()    {        return value;    }    /**     * <p>Creates a {@link Property} instance by reading its bytes     * from the property set stream.</p>     *     * @param id The property's ID.     * @param src The bytes the property set stream consists of.     * @param offset The property's type/value pair's offset in the     * section.     * @param length The property's type/value pair's length in bytes.     * @param codepage The section's and thus the property's     * codepage. It is needed only when reading string values.     * @exception UnsupportedEncodingException if the specified codepage is not     * supported.     */    public Property(final long id, final byte[] src, final long offset,                    final int length, final int codepage)    throws UnsupportedEncodingException    {        this.id = id;        /*         * ID 0 is a special case since it specifies a dictionary of         * property IDs and property names.         */        if (id == 0)        {            value = readDictionary(src, offset, length, codepage);            return;        }        int o = (int) offset;        type = LittleEndian.getUInt(src, o);        o += LittleEndian.INT_SIZE;        try        {            value = VariantSupport.read(src, o, length, (int) type, codepage);        }        catch (UnsupportedVariantTypeException ex)        {            VariantSupport.writeUnsupportedTypeMessage(ex);            value = ex.getValue();        }    }    /**     * <p>Creates an empty property. It must be filled using the set method to     * be usable.</p>     */    protected Property()    { }    /**     * <p>Reads a dictionary.</p>     *      * @param src The byte array containing the bytes making out the dictionary.     * @param offset At this offset within <var>src </var> the dictionary     *        starts.     * @param length The dictionary contains at most this many bytes.     * @param codepage The codepage of the string values.     * @return The dictonary     * @throws UnsupportedEncodingException if the dictionary's codepage is not     *         (yet) supported.     */    protected Map readDictionary(final byte[] src, final long offset,                                 final int length, final int codepage)    throws UnsupportedEncodingException    {        /* Check whether "offset" points into the "src" array". */        if (offset < 0 || offset > src.length)            throw new HPSFRuntimeException                ("Illegal offset " + offset + " while HPSF stream contains " +                 length + " bytes.");        int o = (int) offset;        /*         * Read the number of dictionary entries.         */        final long nrEntries = LittleEndian.getUInt(src, o);        o += LittleEndian.INT_SIZE;        final Map m = new HashMap((int) nrEntries, (float) 1.0);        for (int i = 0; i < nrEntries; i++)        {            /* The key. */            final Long id = new Long(LittleEndian.getUInt(src, o));            o += LittleEndian.INT_SIZE;            /* The value (a string). The length is the either the             * number of (two-byte) characters if the character set is Unicode             * or the number of bytes if the character set is not Unicode.             * The length includes terminating 0x00 bytes which we have to strip             * off to create a Java string. */            long sLength = LittleEndian.getUInt(src, o);            o += LittleEndian.INT_SIZE;            /* Read the string. */            final StringBuffer b = new StringBuffer();            switch (codepage)            {                case -1:                {                    /* Without a codepage the length is equal to the number of                     * bytes. */                    b.append(new String(src, o, (int) sLength));                    break;                }                case Constants.CP_UNICODE:                {                    /* The length is the number of characters, i.e. the number                     * of bytes is twice the number of the characters. */                    for (int j = 0; j < sLength; j++)                    {                        final int i1 = o + (j * 2);                        final int i2 = i1 + 1;                        b.append((char) ((src[i2] << 8) + src[i1]));                    }                    break;                }                default:                {                    /* For encodings other than Unicode the length is the number                     * of bytes. */                    b.append(new String(src, o, (int) sLength,                             VariantSupport.codepageToEncoding(codepage)));                    break;                }            }            /* Strip 0x00 characters from the end of the string: */            while (b.length() > 0 && b.charAt(b.length() - 1) == 0x00)                b.setLength(b.length() - 1);            if (codepage == Constants.CP_UNICODE)            {                if (sLength % 2 == 1)                    sLength++;                o += (sLength + sLength);            }            else                o += sLength;            m.put(id, b.toString());        }        return m;    }    /**     * <p>Returns the property's size in bytes. This is always a multiple of     * 4.</p>     *     * @return the property's size in bytes     *      * @exception WritingNotSupportedException if HPSF does not yet support the     * property's variant type.     */    protected int getSize() throws WritingNotSupportedException    {        int length = VariantSupport.getVariantLength(type);        if (length >= 0)            return length; /* Fixed length */        if (length == -2)            /* Unknown length */            throw new WritingNotSupportedException(type, null);        /* Variable length: */        final int PADDING = 4; /* Pad to multiples of 4. */        switch ((int) type)        {            case Variant.VT_LPSTR:            {                int l = ((String) value).length() + 1;                int r = l % PADDING;                if (r > 0)                    l += PADDING - r;                length += l;                break;            }            case Variant.VT_EMPTY:                break;            default:                throw new WritingNotSupportedException(type, value);        }        return length;    }    /**     * <p>Compares two properties.</p>     *      * <p>Please beware that a property with ID == 0 is a special case: It does not have a type, and its value is the section's     * dictionary. Another special case are strings: Two properties may have     * the different types Variant.VT_LPSTR and Variant.VT_LPWSTR;</p>     *      * @see Object#equals(java.lang.Object)     */    public boolean equals(final Object o)    {        if (!(o instanceof Property))            return false;        final Property p = (Property) o;        final Object pValue = p.getValue();        final long pId = p.getID();        if (id != pId || (id != 0 && !typesAreEqual(type, p.getType())))            return false;        if (value == null && pValue == null)            return true;        if (value == null || pValue == null)            return false;        /* It's clear now that both values are non-null. */        final Class valueClass = value.getClass();        final Class pValueClass = pValue.getClass();        if (!(valueClass.isAssignableFrom(pValueClass)) &&            !(pValueClass.isAssignableFrom(valueClass)))            return false;        if (value instanceof byte[])            return Util.equal((byte[]) value, (byte[]) pValue);        return value.equals(pValue);    }    private boolean typesAreEqual(final long t1, final long t2)    {        if (t1 == t2 ||            (t1 == Variant.VT_LPSTR && t2 == Variant.VT_LPWSTR) ||            (t2 == Variant.VT_LPSTR && t1 == Variant.VT_LPWSTR))            return true;        else            return false;    }    /**     * @see Object#hashCode()     */    public int hashCode()    {        long hashCode = 0;        hashCode += id;        hashCode += type;        if (value != null)            hashCode += value.hashCode();        final int returnHashCode = (int) (hashCode & 0x0ffffffffL );        return returnHashCode;    }    /**     * @see Object#toString()     */    public String toString()    {        final StringBuffer b = new StringBuffer();        b.append(getClass().getName());        b.append('[');        b.append("id: ");        b.append(getID());        b.append(", type: ");        b.append(getType());        final Object value = getValue();        b.append(", value: ");        b.append(value.toString());        if (value instanceof String)        {            final String s = (String) value;            final int l = s.length();            final byte[] bytes = new byte[l * 2];            for (int i = 0; i < l; i++)            {                final char c = s.charAt(i);                final byte high = (byte) ((c & 0x00ff00) >> 8);                final byte low  = (byte) ((c & 0x0000ff) >> 0);                bytes[i * 2]     = high;                bytes[i * 2 + 1] = low;            }            final String hex = HexDump.dump(bytes, 0L, 0);            b.append(" [");            b.append(hex);            b.append("]");        }        b.append(']');        return b.toString();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情图片网| 国产精品午夜在线| 91麻豆精品国产自产在线| 91久久一区二区| 91色porny在线视频| 欧美成人三级在线| 久久久久99精品一区| 国产日韩成人精品| 日韩国产欧美在线观看| 精品亚洲国产成人av制服丝袜| 国产又黄又大久久| 国产精品第13页| 国产精品亚洲人在线观看| 91在线视频观看| 欧洲色大大久久| 欧美国产精品v| 欧美日本一区二区三区| 3d动漫精品啪啪1区2区免费| 精品国产成人在线影院| 国产精品污污网站在线观看| 亚洲激情六月丁香| 日韩精品一区二区三区在线播放 | 理论电影国产精品| 在线观看不卡一区| 国产日韩精品一区二区浪潮av| 亚洲欧美激情在线| 国产精品一级片在线观看| 色综合中文字幕国产 | 在线综合亚洲欧美在线视频| 国产日韩欧美精品电影三级在线| 一区二区三区自拍| 国产a级毛片一区| 欧美性生交片4| 26uuu亚洲综合色| 精品婷婷伊人一区三区三| 国产精品免费视频网站| 日本欧美加勒比视频| 国产在线不卡一区| 久久精品视频一区二区| 亚洲国产一二三| 成人高清视频在线观看| 国产精品久久久久天堂| 美女脱光内衣内裤视频久久网站| 97精品超碰一区二区三区| 欧美一级二级在线观看| 久久电影网站中文字幕| 欧美精品一二三四| 亚洲视频一区在线| 在线视频欧美区| 亚洲欧美在线高清| 岛国精品在线播放| 欧美日韩一二三区| 亚洲综合在线电影| 99天天综合性| 国内不卡的二区三区中文字幕 | 一区二区三区.www| 色天使色偷偷av一区二区| 国产色一区二区| 久久99国产精品麻豆| 久久网站热最新地址| 国内外成人在线| 日韩色在线观看| 国产精品欧美久久久久无广告 | 香蕉久久一区二区不卡无毒影院| 在线看国产一区| 一区二区三区不卡在线观看| 日本高清不卡在线观看| 亚洲午夜电影在线观看| 欧美亚洲综合另类| 亚洲午夜电影在线| 国产高清在线观看免费不卡| 精品第一国产综合精品aⅴ| 国产一区二区三区香蕉| 欧美v国产在线一区二区三区| 日本aⅴ精品一区二区三区| 国产精品第五页| 91黄视频在线| 日韩影院免费视频| 国产女同性恋一区二区| 色综合久久久久综合体桃花网| 一区二区三区在线免费观看| 欧美日韩视频在线观看一区二区三区 | 卡一卡二国产精品| 中国av一区二区三区| 色欧美乱欧美15图片| 亚洲自拍欧美精品| 国产免费久久精品| 91网页版在线| 日韩黄色免费电影| 亚洲欧美日韩国产综合在线| 欧美体内she精高潮| 日精品一区二区三区| 国产精品久久久久久久久久久免费看| 91免费精品国自产拍在线不卡| 亚洲欧美日韩精品久久久久| 久久久精品蜜桃| 99久久99精品久久久久久| 亚洲国产视频a| 久久精品视频网| 日本高清无吗v一区| 亚洲狠狠爱一区二区三区| 综合自拍亚洲综合图不卡区| 欧美一区二区三区四区五区| 国产1区2区3区精品美女| 亚洲午夜免费电影| 亚洲黄色在线视频| 欧美www视频| 欧美性受xxxx| 日日夜夜一区二区| 一区二区三区四区激情| www国产亚洲精品久久麻豆| 成人不卡免费av| 亚洲一区二区三区四区的| 久久久欧美精品sm网站 | 久久久国产精品麻豆| 日韩欧美中文字幕公布| 91香蕉视频在线| 国产精品亚洲第一区在线暖暖韩国| 亚洲最新视频在线观看| 国产精品久久久久久久久久久免费看| 懂色av中文字幕一区二区三区| 午夜精品久久久久久久99水蜜桃| 亚洲午夜视频在线观看| 中文一区在线播放| 精品国产凹凸成av人导航| 99热99精品| 国产成人8x视频一区二区 | 欧美一区二区三区四区五区 | 欧美韩日一区二区三区| 欧美电影免费观看高清完整版在线观看| 91视频一区二区| 韩国三级在线一区| 亚洲午夜久久久久久久久电影院 | 国产女人水真多18毛片18精品视频| 欧美日韩成人高清| 91蜜桃婷婷狠狠久久综合9色| 国产美女精品人人做人人爽| 国产精品一区三区| 黄页网站大全一区二区| 亚洲自拍偷拍图区| 国产精品伦一区| 国产无一区二区| 久久久久久毛片| 欧美一区二区在线观看| 国产偷国产偷亚洲高清人白洁 | 国产白丝精品91爽爽久久| av不卡一区二区三区| 99精品一区二区三区| 岛国精品在线观看| 国产一区二区精品久久99| 美国十次综合导航| 久久国产日韩欧美精品| 蜜桃视频在线观看一区| 成人激情综合网站| 波多野结衣欧美| a亚洲天堂av| 成人动漫在线一区| 51精品久久久久久久蜜臀| 欧美精品 日韩| 日韩精品自拍偷拍| 337p亚洲精品色噜噜狠狠| 欧美精品色一区二区三区| 91精品国产综合久久国产大片 | 久久久精品tv| 亚洲男女一区二区三区| 亚洲国产美国国产综合一区二区| 亚洲18女电影在线观看| 成人黄色大片在线观看| 色综合天天综合色综合av| 欧美丝袜丝交足nylons| 欧美偷拍一区二区| 欧美高清一级片在线观看| 亚洲欧美日韩国产另类专区| 亚洲在线观看免费视频| 亚洲区小说区图片区qvod| 一区二区三区久久| 日本成人在线电影网| 国产精品亚洲第一区在线暖暖韩国| 欧美久久久久久蜜桃| 久久精品亚洲乱码伦伦中文 | 欧美私模裸体表演在线观看| 国产成人欧美日韩在线电影| 在线精品视频免费播放| 久久久久国产成人精品亚洲午夜 | 精品在线观看免费| 欧美群妇大交群的观看方式| 偷拍日韩校园综合在线| 日韩女优视频免费观看| 国产毛片精品一区| 国产精品夫妻自拍| 欧洲人成人精品| 日韩国产一二三区| 久久久亚洲精品石原莉奈| 国产999精品久久久久久| 亚洲日本在线视频观看| 欧美日韩另类国产亚洲欧美一级| 首页国产欧美久久| 久久午夜免费电影| 成人精品高清在线| 性做久久久久久久久|