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

## edu.emory.mathcs.util.collections.shorts
Interface ShortMap

All Known Implementing Classes:
  ShortRadkeHashMap

public interface ShortMap

Map from short keys to object values.

Version:
  1.0
Author:
  Dawid Kurzyniec

Nested Class Summary
`static interface` | `ShortMap.Entry` Represents the mapping from a short key to an object value.

Method Summary
`void` | `clear()` Removes all the mappings.
`boolean` | `containsKey(short key)` Returns true if this map contains mapping for the specified number; false otherwise.
`boolean` | `containsValue(java.lang.Object value)` Returns true if this map contains mapping with the specified value; false otherwise.
`java.util.Set` | `entrySet()` Returns the view of entries in this map, as a Set of ShortMap.Entry elements.
`boolean` | `equals(java.lang.Object o)`
`java.lang.Object` | `get(short key)` Retrieves the mapping for the specified number, or null if none.
`int` | `hashCode()`
`boolean` | `isEmpty()` Returns true if this map is empty; false otherwise.
`ShortSet` | `keySet()` Returns the view of keys in this map, as a ShortSet.
`java.lang.Object` | `put(short key, java.lang.Object value)` Maps specified value to the given short key, and returns the value previously mapped for that key, or null if there were no mapping for that key before.
`void` | `putAll(ShortMap map)` Puts all mappings from the specified map into this map.
`java.lang.Object` | `remove(short key)` Removes the mapping for the given key and returns the removed value, or null if there was no mapping for that key.
`int` | `size()` Returns the number of entries in this map.
`java.util.Collection` | `values()` Returns the read-only view of values in this map, as a Collection.

Method Detail

### size

    public int size()

  Returns the number of entries in this map.

  Returns:
    the number of entries in this map.

### isEmpty

    public boolean isEmpty()

  Returns true if this map is empty; false otherwise.

  Returns:
    true if this map is empty; false otherwise.

### containsKey

    public boolean containsKey(short key)

  Returns true if this map contains mapping for the specified number; false otherwise.

  Returns:
    true if this map contains mapping for the specified number; false otherwise.

### containsValue

    public boolean containsValue(java.lang.Object value)

  Returns true if this map contains mapping with the specified value; false otherwise. Usually, this method has a linear complexity.

  Returns:
    true if this map contains mapping with the specified value; false otherwise.

### get

    public java.lang.Object get(short key)

  Retrieves the mapping for the specified number, or null if none.

  Parameters:
    `key` - the search key
  Returns:
    the mapping for the specified number, or null if none.

### put

    public java.lang.Object put(short key,
                                java.lang.Object value)

  Maps specified value to the given short key, and returns the value previously mapped for that key, or null if there were no mapping for that key before.

  Parameters:
    `key` - the key
    `value` - the value
  Returns:
    the value previously mapped to key, or null if none

### remove

    public java.lang.Object remove(short key)

  Removes the mapping for the given key and returns the removed value, or null if there was no mapping for that key.

  Parameters:
    `key` - the key to remove the mapping for
  Returns:
    the value mapped to the key

### putAll

    public void putAll(ShortMap map)

  Puts all mappings from the specified map into this map.

  Parameters:
    `map` - the map to copy the mappings from.

### clear

    public void clear()

  Removes all the mappings.

### keySet

    public ShortSet keySet()

  Returns the view of keys in this map, as a ShortSet. The view is backed by this map. Supports removals.

  Returns:
    the key set view of this map

### values

    public java.util.Collection values()

  Returns the read-only view of values in this map, as a Collection. The view is backed by this map.

  Returns:
    the value view of this map

### entrySet

    public java.util.Set entrySet()

  Returns the view of entries in this map, as a Set of ShortMap.Entry elements. The view is backed by this map. Supports removals, and value changes via entry.setValue().

  Returns:
    the entry set view of this map

### equals

    public boolean equals(java.lang.Object o)

### hashCode

    public int hashCode()

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