API  1.0.0
CPNull.j
Go to the documentation of this file.
1 /*
2  * CPNull.j
3  * Foundation
4  *
5  * Created by Francisco Tolmasky.
6  * Copyright 2008, 280 North, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 
24 var CPNullSharedNull = nil;
25 
33 @implementation CPNull : CPObject
34 {
35  id __doxygen__;
36 }
37 
38 /*+ (id)alloc
39 {
40  if (CPNullSharedNull)
41  return CPNullSharedNull;
42 
43  return [super alloc];
44 }*/
45 
51 + (CPNull)null
52 {
53  if (!CPNullSharedNull)
54  CPNullSharedNull = [[CPNull alloc] init];
55 
56  return CPNullSharedNull;
57 }
58 
59 - (BOOL)isEqual:(id)anObject
60 {
61  if (self === anObject)
62  return YES;
63 
64  return [anObject isKindOfClass:[CPNull class]];
65 }
66 
72 - (id)initWithCoder:(CPCoder)aCoder
73 {
74  return [CPNull null];
75 }
76 
82 - (void)encodeWithCoder:(CPCoder)aCoder
83 {
84 }
85 
86 @end
var isEqual
An object representation of nil.
Definition: CPNull.h:2
CPNull null()
Definition: CPNull.j:51
Defines methods for use when archiving & restoring (enc/decoding).
Definition: CPCoder.h:2
Class class()
Definition: CPObject.j:179
var CPNullSharedNull
Definition: CPNull.j:24
id alloc()
Definition: CPObject.j:130