net.wotonomy.foundation
Class NSNull

java.lang.Object
  extended by net.wotonomy.foundation.NSNull
All Implemented Interfaces:
java.io.Serializable

public class NSNull
extends java.lang.Object
implements java.io.Serializable

NSNull is used to represent null in Collections classes because List and Map do not specify whether null values are allowed and because NSArray and NSDictionary explicitly do not allow null values.

Use of the static singleton method nullValue() is required by this implementation because Java cannot return a singleton instance from a constructor. Even then, more than one instance may exist in the application due to object serialization. Be sure to compare with equals().

Version:
$Revision: 892 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Method Summary
 boolean equals(java.lang.Object anObject)
          Implemented to return true for any instance of NSNull.
 int hashCode()
          Hashcode of all instances is zero.
static NSNull nullValue()
          Returns the static instance of nullValue.
 java.lang.String toString()
          Returns a human-readable string representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

nullValue

public static NSNull nullValue()
Returns the static instance of nullValue. Note that serialization may mean that more than one instance of NSNull exists, so be sure to compare with equals().


toString

public java.lang.String toString()
Returns a human-readable string representation.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Hashcode of all instances is zero.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object anObject)
Implemented to return true for any instance of NSNull.

Overrides:
equals in class java.lang.Object


Copyright © 2006 null. All Rights Reserved.