public static class AbstractMap.SimpleImmutableEntry 
 extends Object implements Entry<K, V>, Serializable
| java.lang.Object | |
| java.util.AbstractMap.SimpleImmutableEntry<K, V> | |
一个条目维护一个不可变的键和值。 该课程不支持方法setValue 。 在返回键值映射的线程安全快照的方法中,此类可能很方便。
| Public constructors | |
|---|---|
|  AbstractMap.SimpleImmutableEntry(K key, V value) 创建一个表示从指定键到指定值的映射的条目。 | |
|  AbstractMap.SimpleImmutableEntry(Entry<? extends K, ? extends V> entry) 创建一个表示与指定条目相同映射的条目。 | |
| 公共方法(Public methods) | |
|---|---|
|  boolean |  equals(Object o) 将指定的对象与此条目进行比较以求相等。 | 
|  K |  getKey() 返回与此条目对应的键。 | 
|  V |  getValue() 返回与此条目相对应的值。 | 
|  int |  hashCode() 返回此映射条目的哈希码值。 | 
|  V |  setValue(V value) 用指定的值替换与此条目相对应的值(可选操作)。 | 
|  String |  toString() 返回此映射条目的字符串表示形式。 | 
| 继承方法(Inherited methods) | |
|---|---|
|  From class  java.lang.Object  | |
|  From interface  java.util.Map.Entry  | |
AbstractMap.SimpleImmutableEntry (K key, 
                V value) 
     创建一个表示从指定键到指定值的映射的条目。
| 参数(Parameters) | |
|---|---|
| key | K: the key represented by this entry | 
| value | V: the value represented by this entry | 
AbstractMap.SimpleImmutableEntry (Entry<? extends K, ? extends V> entry)
创建一个表示与指定条目相同映射的条目。
| 参数(Parameters) | |
|---|---|
| entry | Entry: the entry to copy | 
boolean equals (Object o)
将指定的对象与此条目进行比较以求相等。 如果给定的对象也是映射条目并且两个条目表示相同的映射,则返回true 。 更正式地,如果两个条目e1和e2表示相同的映射
   (e1.getKey()==null ?
    e2.getKey()==null :
    e1.getKey().equals(e2.getKey()))
   &&
   (e1.getValue()==null ?
    e2.getValue()==null :
    e1.getValue().equals(e2.getValue())) This ensures that the 
     equals method works properly across different implementations of the 
     Map.Entry interface. 
      
     | 参数(Parameters) | |
|---|---|
| o | Object: object to be compared for equality with this map entry | 
| 返回(Returns) | |
|---|---|
| boolean | trueif the specified object is equal to this map entry | 
也可以看看:
K getKey ()
返回与此条目对应的键。
| 返回(Returns) | |
|---|---|
| K | the key corresponding to this entry | 
V getValue ()
返回与此条目相对应的值。
| 返回(Returns) | |
|---|---|
| V | the value corresponding to this entry | 
int hashCode ()
返回此映射条目的哈希码值。 映射条目e的哈希码被定义为:
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 : e.getValue().hashCode())This ensures that
e1.equals(e2) implies that 
     e1.hashCode()==e2.hashCode() for any two Entries 
     e1 and 
     e2, as required by the general contract of 
     hashCode(). 
      
     | 返回(Returns) | |
|---|---|
| int | the hash code value for this map entry | 
也可以看看:
V setValue (V value)
用指定的值替换与此条目相对应的值(可选操作)。 这个实现只是抛出UnsupportedOperationException ,因为这个类实现了一个不可变的映射条目。
| 参数(Parameters) | |
|---|---|
| value | V: new value to be stored in this entry | 
| 返回(Returns) | |
|---|---|
| V | (Does not return) | 
| 抛出异常(Throws) | |
|---|---|
| UnsupportedOperationException | always | 
String toString ()
返回此映射条目的字符串表示形式。 此实现返回此条目的键的字符串表示形式,后跟等号字符(“ = ”),后跟此条目值的字符串表示形式。
| 返回(Returns) | |
|---|---|
| String | a String representation of this map entry |