Top Description Fields Constructors Methods
org.python.core

pack-priv Class SimpleEntry

Located in compilation unit of org.python.core.AbstractDict.

extends Object
implements Entry
Class Inheritance
All Implemented Interfaces
java.util.Map.Entry
Known Direct Subclasses
org.python.core.PyToJavaMapEntry, org.python.core.JavaToPyMapEntry

Basic implementation of Entry that just holds onto a key and value and returns them.

Field Summary

Modifier and TypeField and Description
protected Object
protected Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
eq(Object o1, Object o2)

public boolean
equals(Object
object to be compared for equality with this map entry
o
)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Compares the specified object with this entry for equality.

public Object
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

public Object
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry.

public Object
setValue(Object
new value to be stored in this entry
val
)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

keyback to summary
protected Object key
valueback to summary
protected Object value

Constructor Detail

SimpleEntryback to summary
public SimpleEntry(Object key, Object value)

Method Detail

eqback to summary
private static boolean eq(Object o1, Object o2)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Doc from java.util.Map.Entry.equals.

Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if

    (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

true if the specified object is equal to this map entry

Annotations
@Override

getKeyback to summary
public Object getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

Returns:Object

the key corresponding to this entry

getValueback to summary
public Object getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.getValue.

Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:Object

the value corresponding to this entry

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Doc from java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry. The hash code of a map entry e is defined to be:

    (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 Object.hashCode.
Returns:int

the hash code value for this map entry

Annotations
@Override

setValueback to summary
public Object setValue(Object val)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters
val:Object

new value to be stored in this entry

Returns:Object

old value corresponding to the entry

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override