Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.3.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.collections
Class MapEntryParameter

    java.lang.Object
      com.sleepycat.collections.MapEntryParameter

All Implemented Interfaces:
  Map.Entry

public class MapEntryParameter
extends Object
implements Map.Entry

A simple `Map.Entry` implementation that can be used as in input parameter. Since a `MapEntryParameter` is not obtained from a map, it is not attached to any map in particular. To emphasize that changing this object does not change the map, the `setValue(java.lang.Object)` method always throws `UnsupportedOperationException`.

Warning: Use of this interface violates the Java Collections interface contract since these state that `Map.Entry` objects should only be obtained from `Map.entrySet()` sets, while this class allows constructing them directly. However, it is useful for performing operations on an entry set such as add(), contains(), etc. For restrictions see `getValue()` and `setValue(java.lang.Object)`.

Constructor Summary
`MapEntryParameter(Object key, Object value)` Creates a map entry with a given key and value.

Method Summary
`boolean` | `equals(Object other)` Compares this entry to a given entry as specified by `Map.Entry.equals(java.lang.Object)`.
`Object` | `getKey()` Returns the key of this entry.
`Object` | `getValue()` Returns the value of this entry.
`int` | `hashCode()` Computes a hash code as specified by `Map.Entry.hashCode()`.
`Object` | `setValue(Object newValue)` Always throws `UnsupportedOperationException` since this object is not attached to a map.
`String` | `toString()` Converts the entry to a string representation for debugging.

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MapEntryParameter

    public MapEntryParameter(Object key,
                             Object value)

  Creates a map entry with a given key and value.

Parameters:
  `key` - is the key to use.
  `value` - is the value to use.

Method Detail

### hashCode

    public int hashCode()

  Computes a hash code as specified by `Map.Entry.hashCode()`.

  Specified by:
    `hashCode` in interface `Map.Entry`
  Returns:
    the computed hash code.

### equals

    public boolean equals(Object other)

  Compares this entry to a given entry as specified by `Map.Entry.equals(java.lang.Object)`.

  Specified by:
    `equals` in interface `Map.Entry`
  Returns:
    the computed hash code.

### getKey

    public final Object getKey()

  Returns the key of this entry.

  Specified by:
    `getKey` in interface `Map.Entry`
  Returns:
    the key of this entry.

### getValue

    public final Object getValue()

  Returns the value of this entry. Note that this will be the value passed to the constructor or the last value passed to `setValue(java.lang.Object)`. It will not reflect changes made to a Map.

  Specified by:
    `getValue` in interface `Map.Entry`
  Returns:
    the value of this entry.

### setValue

    public Object setValue(Object newValue)

  Always throws `UnsupportedOperationException` since this object is not attached to a map.

  Specified by:
    `setValue` in interface `Map.Entry`

### toString

    public String toString()

  Converts the entry to a string representation for debugging.

  Returns:
    the string representation.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.3.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.