本文整理了Java中org.apache.tomcat.util.net.URL.compare()
方法的一些代码示例,展示了URL.compare()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URL.compare()
方法的具体详情如下:
包路径:org.apache.tomcat.util.net.URL
类名称:URL
方法名:compare
[英]Compare to String values for equality, taking appropriate care if one or both of the values are null
.
[中]比较字符串值是否相等,如果其中一个或两个值均为null
,请适当注意。
代码示例来源:origin: org.jboss.web/jbossweb
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: jboss.web/jbossweb
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Compare two URLs, excluding the "ref" fields. Returns <code>true</code>
* if this <code>URL</code> and the <code>other</code> argument both refer
* to the same resource. The two <code>URLs</code> might not both contain
* the same anchor.
*/
public boolean sameFile(URL other) {
if (!compare(protocol, other.getProtocol()))
return (false);
if (!compare(host, other.getHost()))
return (false);
if (port != other.getPort())
return (false);
if (!compare(file, other.getFile()))
return (false);
return (true);
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
public boolean equals(Object obj) {
if (obj == null)
return (false);
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
代码示例来源:origin: org.jboss.web/jbossweb
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
public boolean equals(Object obj) {
if (obj == null)
return (false);
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
代码示例来源:origin: jboss.web/jbossweb
/**
* Compare two URLs for equality. The result is <code>true</code> if and
* only if the argument is not null, and is a <code>URL</code> object
* that represents the same <code>URL</code> as this object. Two
* <code>URLs</code> are equal if they have the same protocol and
* reference the same host, the same port number on the host,
* and the same file and anchor on the host.
*
* @param obj The URL to compare against
*/
public boolean equals(Object obj) {
if (obj == null)
return (false);
if (!(obj instanceof URL))
return (false);
URL other = (URL) obj;
if (!sameFile(other))
return (false);
return (compare(ref, other.getRef()));
}
内容来源于网络,如有侵权,请联系作者删除!