Package org.json
Class JSONObject.Null
- java.lang.Object
-
- org.json.JSONObject.Null
-
- Enclosing class:
- JSONObject
private static final class JSONObject.Null extends java.lang.ObjectJSONObject.NULL is equivalent to the value that JavaScript calls null, whilst Java's null is equivalent to the value that JavaScript calls undefined.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateNull()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Objectclone()There is only intended to be a single instance of the NULL object, so the clone method returns itself.booleanequals(java.lang.Object object)A Null object is equal to the null value and to itself.inthashCode()A Null object is equal to the null value and to itself.java.lang.StringtoString()Get the "null" string value.
-
-
-
Method Detail
-
clone
protected final java.lang.Object clone()
There is only intended to be a single instance of the NULL object, so the clone method returns itself.- Overrides:
clonein classjava.lang.Object- Returns:
- NULL.
-
equals
public boolean equals(java.lang.Object object)
A Null object is equal to the null value and to itself.- Overrides:
equalsin classjava.lang.Object- Parameters:
object- An object to test for nullness.- Returns:
- true if the object parameter is the JSONObject.NULL object or null.
-
hashCode
public int hashCode()
A Null object is equal to the null value and to itself.- Overrides:
hashCodein classjava.lang.Object- Returns:
- always returns 0.
-
toString
public java.lang.String toString()
Get the "null" string value.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string "null".
-
-