当前位置: 首页>>代码示例>>Java>>正文


Java ASCIICaseInsensitiveComparator类代码示例

本文整理汇总了Java中sun.misc.ASCIICaseInsensitiveComparator的典型用法代码示例。如果您正苦于以下问题:Java ASCIICaseInsensitiveComparator类的具体用法?Java ASCIICaseInsensitiveComparator怎么用?Java ASCIICaseInsensitiveComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ASCIICaseInsensitiveComparator类属于sun.misc包,在下文中一共展示了ASCIICaseInsensitiveComparator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: equals

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Compares this attribute name to another for equality.
 * @param o the object to compare
 * @return true if this attribute name is equal to the
 *         specified attribute object
 */
public boolean equals(Object o) {
    if (o instanceof Name) {
        Comparator<String> c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
        return c.compare(name, ((Name)o).name) == 0;
    } else {
        return false;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:Attributes.java

示例2: hashCode

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Computes the hash value for this attribute name.
 */
public int hashCode() {
    if (hashCode == -1) {
        hashCode = ASCIICaseInsensitiveComparator.lowerCaseHashCode(name);
    }
    return hashCode;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Attributes.java

示例3: equals

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Compares this attribute name to another for equality.
 * @param o the object to compare
        * @return true if this attribute name is equal to the
        *         specified attribute object
 */
public boolean equals(Object o) {
    if (o instanceof Name) {
	Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
	return c.compare(name, ((Name)o).name) == 0;
    } else {
	return false;
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:15,代码来源:Attributes.java

示例4: hashCode

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Computes the hash value for this attribute name.
 */
       public int hashCode() {
    if (hashCode == -1) {
	hashCode = ASCIICaseInsensitiveComparator.lowerCaseHashCode(name);
    }
    return hashCode;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:10,代码来源:Attributes.java

示例5: equals

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Compares this attribute name to another for equality.
 * @param o the object to compare
 * @return true if this attribute name is equal to the
 *         specified attribute object
 */
public boolean equals(Object o) {
    if (o instanceof Name) {
        Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
        return c.compare(name, ((Name)o).name) == 0;
    } else {
        return false;
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:15,代码来源:Attributes.java

示例6: availableCharsets

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Constructs a sorted map from canonical charset names to charset objects.
 *
 * <p> The map returned by this method will have one entry for each charset
 * for which support is available in the current Java virtual machine.  If
 * two or more supported charsets have the same canonical name then the
 * resulting map will contain just one of them; which one it will contain
 * is not specified. </p>
 *
 * <p> The invocation of this method, and the subsequent use of the
 * resulting map, may cause time-consuming disk or network I/O operations
 * to occur.  This method is provided for applications that need to
 * enumerate all of the available charsets, for example to allow user
 * charset selection.  This method is not used by the {@link #forName
 * forName} method, which instead employs an efficient incremental lookup
 * algorithm.
 *
 * <p> This method may return different results at different times if new
 * charset providers are dynamically made available to the current Java
 * virtual machine.  In the absence of such changes, the charsets returned
 * by this method are exactly those that can be retrieved via the {@link
 * #forName forName} method.  </p>
 *
 * @return An immutable, case-insensitive map from canonical charset names
 *         to charset objects
 */
public static SortedMap<String,Charset> availableCharsets() {
    return AccessController.doPrivileged(
        new PrivilegedAction<SortedMap<String,Charset>>() {
            public SortedMap<String,Charset> run() {
                TreeMap<String,Charset> m =
                    new TreeMap<String,Charset>(
                        ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER);
                put(standardProvider.charsets(), m);
                CharsetProvider ecp = ExtendedProviderHolder.extendedProvider;
                if (ecp != null)
                    put(ecp.charsets(), m);
                for (Iterator<CharsetProvider> i = providers(); i.hasNext();) {
                    CharsetProvider cp = i.next();
                    put(cp.charsets(), m);
                }
                return Collections.unmodifiableSortedMap(m);
            }
        });
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:Charset.java

示例7: availableCharsets

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Constructs a sorted map from canonical charset names to charset objects.
 *
 * <p> The map returned by this method will have one entry for each charset
 * for which support is available in the current Java virtual machine.  If
 * two or more supported charsets have the same canonical name then the
 * resulting map will contain just one of them; which one it will contain
 * is not specified. </p>
 *
 * <p> The invocation of this method, and the subsequent use of the
 * resulting map, may cause time-consuming disk or network I/O operations
 * to occur.  This method is provided for applications that need to
 * enumerate all of the available charsets, for example to allow user
 * charset selection.  This method is not used by the {@link #forName
 * forName} method, which instead employs an efficient incremental lookup
 * algorithm.
 *
 * <p> This method may return different results at different times if new
 * charset providers are dynamically made available to the current Java
 * virtual machine.  In the absence of such changes, the charsets returned
 * by this method are exactly those that can be retrieved via the {@link
 * #forName forName} method.  </p>
 *
 * @return An immutable, case-insensitive map from canonical charset names
 *         to charset objects
 */
public static SortedMap<String,Charset> availableCharsets() {
    return AccessController.doPrivileged(
        new PrivilegedAction<SortedMap<String,Charset>>() {
            public SortedMap<String,Charset> run() {
                TreeMap<String,Charset> m =
                    new TreeMap<String,Charset>(
                        ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER);
                put(standardProvider.charsets(), m);
                CharsetProvider ecp = ExtendedProviderHolder.extendedProvider;
                if (ecp != null)
                    put(ecp.charsets(), m);
                for (Iterator i = providers(); i.hasNext();) {
                    CharsetProvider cp = (CharsetProvider)i.next();
                    put(cp.charsets(), m);
                }
                return Collections.unmodifiableSortedMap(m);
            }
        });
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:46,代码来源:Charset.java

示例8: availableCharsets

import sun.misc.ASCIICaseInsensitiveComparator; //导入依赖的package包/类
/**
 * Constructs a sorted map from canonical charset names to charset objects.
 *
 * <p> The map returned by this method will have one entry for each charset
 * for which support is available in the current Java virtual machine.  If
 * two or more supported charsets have the same canonical name then the
 * resulting map will contain just one of them; which one it will contain
 * is not specified. </p>
 *
 * <p> The invocation of this method, and the subsequent use of the
 * resulting map, may cause time-consuming disk or network I/O operations
 * to occur.  This method is provided for applications that need to
 * enumerate all of the available charsets, for example to allow user
 * charset selection.  This method is not used by the {@link #forName
 * forName} method, which instead employs an efficient incremental lookup
 * algorithm.
 *
 * <p> This method may return different results at different times if new
 * charset providers are dynamically made available to the current Java
 * virtual machine.  In the absence of such changes, the charsets returned
 * by this method are exactly those that can be retrieved via the {@link
 * #forName forName} method.  </p>
 *
 * @return An immutable, case-insensitive map from canonical charset names
 *         to charset objects
 */
public static SortedMap<String,Charset> availableCharsets() {
    return AccessController.doPrivileged(
        new PrivilegedAction<SortedMap<String,Charset>>() {
            public SortedMap<String,Charset> run() {
                TreeMap<String,Charset> m =
                    new TreeMap<String,Charset>(
                        ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER);
                put(standardProvider.charsets(), m);
                for (Iterator i = providers(); i.hasNext();) {
                    CharsetProvider cp = (CharsetProvider)i.next();
                    put(cp.charsets(), m);
                }
                return Collections.unmodifiableSortedMap(m);
            }
        });
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:43,代码来源:Charset.java


注:本文中的sun.misc.ASCIICaseInsensitiveComparator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。