Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class Collections.EmptyMap  view Collections.EmptyMap download Collections.EmptyMap.java

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.Collections.EmptyMap
All Implemented Interfaces:
Map, java.io.Serializable
Enclosing class:
Collections

private static final class Collections.EmptyMap
extends AbstractMap
implements java.io.Serializable

The implementation of Collections.EMPTY_MAP 55 . This class name is required for compatibility with Sun's JDK serializability.


Nested Class Summary
 
Nested classes inherited from class java.util.AbstractMap
AbstractMap.BasicMapEntry
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
private static long serialVersionUID
          Compatible with JDK 1.4.
 
Fields inherited from class java.util.AbstractMap
ENTRIES, keys, KEYS, values, VALUES
 
Constructor Summary
(package private) Collections.EmptyMap()
          A private constructor adds overhead.
 
Method Summary
 boolean containsKey(java.lang.Object key)
          No entries!
 boolean containsValue(java.lang.Object value)
          No entries!
 Set entrySet()
          There are no entries.
 boolean equals(java.lang.Object o)
          Equal to all empty maps.
 java.lang.Object get(java.lang.Object o)
          No mappings, so this returns null.
 int hashCode()
          The hashcode is always 0.
 Set keySet()
          No entries.
 java.lang.Object remove(java.lang.Object o)
          Remove always succeeds, with null result.
 int size()
          Size is always 0.
 java.lang.String toString()
          The string never changes.
 Collection values()
          No entries.
 
Methods inherited from class java.util.AbstractMap
clear, clone, equals, hashCode, isEmpty, put, putAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Compatible with JDK 1.4.

See Also:
Constant Field Values
Constructor Detail

Collections.EmptyMap

Collections.EmptyMap()
A private constructor adds overhead.

Method Detail

entrySet

public Set entrySet()
There are no entries.

Specified by:
entrySet in interface Map
Specified by:
entrySet in class AbstractMap

containsKey

public boolean containsKey(java.lang.Object key)
No entries!

Specified by:
containsKey in interface Map
Overrides:
containsKey in class AbstractMap

containsValue

public boolean containsValue(java.lang.Object value)
No entries!

Specified by:
containsValue in interface Map
Overrides:
containsValue in class AbstractMap

equals

public boolean equals(java.lang.Object o)
Equal to all empty maps.

Specified by:
equals in interface Map
Overrides:
equals in class AbstractMap

get

public java.lang.Object get(java.lang.Object o)
No mappings, so this returns null.

Specified by:
get in interface Map
Overrides:
get in class AbstractMap

hashCode

public int hashCode()
The hashcode is always 0.

Specified by:
hashCode in interface Map
Overrides:
hashCode in class AbstractMap

keySet

public Set keySet()
No entries.

Specified by:
keySet in interface Map
Overrides:
keySet in class AbstractMap

remove

public java.lang.Object remove(java.lang.Object o)
Remove always succeeds, with null result.

Specified by:
remove in interface Map
Overrides:
remove in class AbstractMap

size

public int size()
Size is always 0.

Specified by:
size in interface Map
Overrides:
size in class AbstractMap

values

public Collection values()
No entries. Technically, EMPTY_SET, while more specific than a general Collection, will work. Besides, that's what the JDK uses!

Specified by:
values in interface Map
Overrides:
values in class AbstractMap

toString

public java.lang.String toString()
The string never changes.

Overrides:
toString in class AbstractMap