Most visited

Recently visited

Added in API level 1

IntentFilter.AuthorityEntry

public static final class IntentFilter.AuthorityEntry
extends Object

java.lang.Object
   ↳ android.content.IntentFilter.AuthorityEntry


这是Iterator中由 authoritiesIterator()返回的单个权限的条目。

Summary

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

From class java.lang.Object

Public constructors

IntentFilter.AuthorityEntry

Added in API level 1
IntentFilter.AuthorityEntry (String host, 
                String port)

Parameters
host String
port String

Public methods

equals

Added in API level 1
boolean equals (Object obj)

指示其他某个对象是否“等于”这一个。

equals方法在非空对象引用上实现等价关系:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values 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.
  • For any non-null reference value x, x.equals(null) should return false.

Objectequals方法实现了对象上最可能的等价关系; 也就是说,对于任何非空参考值xy ,当且仅当xy引用同一对象( 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.

getHost

Added in API level 1
String getHost ()

Returns
String

getPort

Added in API level 1
int getPort ()

Returns
int

match

Added in API level 1
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.

Hooray!