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


Java Util.wildmatch方法代码示例

本文整理汇总了Java中com.sun.jmx.mbeanserver.Util.wildmatch方法的典型用法代码示例。如果您正苦于以下问题:Java Util.wildmatch方法的具体用法?Java Util.wildmatch怎么用?Java Util.wildmatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jmx.mbeanserver.Util的用法示例。


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

示例1: matchDomains

import com.sun.jmx.mbeanserver.Util; //导入方法依赖的package包/类
private final boolean matchDomains(ObjectName name) {
    if (_domain_pattern) {
        // wildmatch domains
        // This ObjectName is the pattern
        // The other ObjectName is the string.
        return Util.wildmatch(name.getDomain(),getDomain());
    }
    return getDomain().equals(name.getDomain());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:ObjectName.java

示例2: matchDomains

import com.sun.jmx.mbeanserver.Util; //导入方法依赖的package包/类
private final boolean matchDomains(ObjectName name) {
    if (isDomainPattern()) {
        // wildmatch domains
        // This ObjectName is the pattern
        // The other ObjectName is the string.
        return Util.wildmatch(name.getDomain(),getDomain());
    }
    return getDomain().equals(name.getDomain());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:ObjectName.java

示例3: matchKeys

import com.sun.jmx.mbeanserver.Util; //导入方法依赖的package包/类
private final boolean matchKeys(ObjectName name) {
    // If key property value pattern but not key property list
    // pattern, then the number of key properties must be equal
    //
    if (_property_value_pattern &&
        !_property_list_pattern &&
        (name._ca_array.length != _ca_array.length))
            return false;

    // If key property value pattern or key property list pattern,
    // then every property inside pattern should exist in name
    //
    if (_property_value_pattern || _property_list_pattern) {
        final Map<String,String> nameProps = name._getKeyPropertyList();
        final Property[] props = _ca_array;
        final String cn = _canonicalName;
        for (int i = props.length - 1; i >= 0 ; i--) {
            // Find value in given object name for key at current
            // index in receiver
            //
            final Property p = props[i];
            final String   k = p.getKeyString(cn);
            final String   v = nameProps.get(k);
            // Did we find a value for this key ?
            //
            if (v == null) return false;
            // If this property is ok (same key, same value), go to next
            //
            if (_property_value_pattern && (p instanceof PatternProperty)) {
                // wildmatch key property values
                // p is the property pattern, v is the string
                if (Util.wildmatch(v,p.getValueString(cn)))
                    continue;
                else
                    return false;
            }
            if (v.equals(p.getValueString(cn))) continue;
            return false;
        }
        return true;
    }

    // If no pattern, then canonical names must be equal
    //
    final String p1 = name.getCanonicalKeyPropertyListString();
    final String p2 = getCanonicalKeyPropertyListString();
    return (p1.equals(p2));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:ObjectName.java

示例4: matchKeys

import com.sun.jmx.mbeanserver.Util; //导入方法依赖的package包/类
private final boolean matchKeys(ObjectName name) {
    // If key property value pattern but not key property list
    // pattern, then the number of key properties must be equal
    //
    if (isPropertyValuePattern() &&
        !isPropertyListPattern() &&
        (name._ca_array.length != _ca_array.length))
            return false;

    // If key property value pattern or key property list pattern,
    // then every property inside pattern should exist in name
    //
    if (isPropertyPattern()) {
        final Map<String,String> nameProps = name._getKeyPropertyList();
        final Property[] props = _ca_array;
        final String cn = _canonicalName;
        for (int i = props.length - 1; i >= 0 ; i--) {
            // Find value in given object name for key at current
            // index in receiver
            //
            final Property p = props[i];
            final String   k = p.getKeyString(cn);
            final String   v = nameProps.get(k);
            // Did we find a value for this key ?
            //
            if (v == null) return false;
            // If this property is ok (same key, same value), go to next
            //
            if (isPropertyValuePattern() && (p instanceof PatternProperty)) {
                // wildmatch key property values
                // p is the property pattern, v is the string
                if (Util.wildmatch(v,p.getValueString(cn)))
                    continue;
                else
                    return false;
            }
            if (v.equals(p.getValueString(cn))) continue;
            return false;
        }
        return true;
    }

    // If no pattern, then canonical names must be equal
    //
    final String p1 = name.getCanonicalKeyPropertyListString();
    final String p2 = getCanonicalKeyPropertyListString();
    return (p1.equals(p2));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:49,代码来源:ObjectName.java


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