public static final class IntentFilter.AuthorityEntry
extends Object
| java.lang.Object | |
| android.content.IntentFilter.AuthorityEntry | |
这是Iterator中由 authoritiesIterator()返回的单个权限的条目。
Public constructors |
|
|---|---|
IntentFilter.AuthorityEntry(String host, String port) |
|
公共方法(Public methods) |
|
|---|---|
boolean |
equals(Object obj) 指示其他某个对象是否“等于”这一个。 |
String |
getHost() |
int |
getPort() |
int |
match(Uri data) 确定这个AuthorityEntry是否匹配给定的数据Uri。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
IntentFilter.AuthorityEntry (String host, String port)
| 参数(Parameters) | |
|---|---|
host |
String
|
port |
String
|
boolean equals (Object obj)
指示其他某个对象是否“等于”这一个。
equals方法在非空对象引用上实现等价关系:
x, x.equals(x) should return true. x and y, x.equals(y) should return true if and only if y.equals(x) returns true. x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true. x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified. x, x.equals(null) should return false. 类Object的equals方法实现了对象上最可能的等价关系; 也就是说,对于任何非空参考值x和y ,当且仅当x和y引用同一对象( x == y的值为true )时,此方法返回true 。
请注意,无论何时覆盖此方法,通常都需要重写 hashCode方法,以便维护 hashCode方法的一般合同,该方法声明相等对象必须具有相同的哈希代码。
| 参数(Parameters) | |
|---|---|
obj |
Object: the reference object with which to compare. |
| 返回(Returns) | |
|---|---|
boolean |
true if this object is the same as the obj argument; false otherwise. |
int match (Uri data)
确定这个AuthorityEntry是否匹配给定的数据Uri。 请注意,此比较区分大小写,与正式的RFC主机名称不同。 因此,您应该始终将其归一化为小写。
| 参数(Parameters) | |
|---|---|
data |
Uri: The Uri to match. |
| 返回(Returns) | |
|---|---|
int |
Returns either NO_MATCH_DATA, MATCH_CATEGORY_PORT, or MATCH_CATEGORY_HOST. |