A pair containing a key and an associated value called the item. Used primarily to represent the elements of a Map. The type Entry<Key,Item> may be abbreviated Key->Item. An instance of Entry may be constructed using the -> operator:

String->Person entry = person.name->person;
By: Gavin

no subtypes hierarchy

Initializer
Entry(Key key, Item item)
Parameters:
  • key

    The key used to access the entry.

  • item

    The item associated with the key.

Attributes
coalescedSource Codeshared <Key->Item&Object>? coalesced

An Entry with the key and item of this entry if this entry's item is non-null, or null otherwise.

hashSource Codeshared actual Integer hash

The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:

  • if x==y then x.hash==y.hash.

Therefore, a class which refines Object.equals() must also refine hash.

In general, hash values vary between platforms and between executions of the same program.

Note that when executing on a Java Virtual Machine, the 64-bit Integer value returned by an implementation of hash is truncated to a 32-bit integer value by removal of the 32 highest order bits, before returning the value to the caller.

Refines Object.hash
itemSource Codeshared Item item

The item associated with the key.

keySource Codeshared Key key

The key used to access the entry.

pairSource Codeshared [Key, Item] pair

A pair (2 element tuple) with the key and item of this entry. For any entry:

entry.pair == [entry.key,entry.item]
stringSource Codeshared actual String string

A description of the entry in the form key->item. If item is null, its string representation is the string "<null>".

Inherited Attributes
Attributes inherited from: Object
Methods
equalsSource Codeshared actual Boolean equals(Object that)

Determines if this entry is equal to the given entry. Two entries are equal if they have the same key and the same item.

  • The keys are considered the same if they are equal, in the sense of value equality.
  • Two items are considered the same if they are both null or if neither is null and they are equal.
Inherited Methods
Methods inherited from: Object