Oolite
1.91.0.7659-250410-0031890
Toggle main menu visibility
Main Page
Topics
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
z
Enumerations
g
k
m
o
r
s
t
w
Enumerator
a
b
c
d
e
g
j
k
m
n
o
p
r
s
t
u
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Modules
Pages
Loading...
Searching...
No Matches
src
Core
OOExcludeObjectEnumerator.m
Go to the documentation of this file.
1
/*
2
3
OOExcludeObjectEnumerator.m
4
5
6
Oolite
7
Copyright (C) 2004-2013 Giles C Williams and contributors
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
MA 02110-1301, USA.
23
24
*/
25
26
#import "
OOExcludeObjectEnumerator.h
"
27
28
29
@implementation
OOExcludeObjectEnumerator
30
31
- (id) initWithEnumerator:(NSEnumerator *)enumerator
32
excludingObject:(
id
)object
33
{
34
if
((
self
= [super init]))
35
{
36
_enumerator
= [
enumerator
retain];
37
_excludeObject
= [
object
retain];
38
}
39
40
return
self
;
41
}
31
- (id) initWithEnumerator:(NSEnumerator *)enumerator {
…
}
42
43
44
- (void)
dealloc
45
{
46
[
_enumerator
release];
47
[_excludeObject release];
48
49
[
super
dealloc];
50
}
44
- (void)
dealloc
{
…
}
51
52
53
+ (id) enumeratorWithEnumerator:(NSEnumerator *)enumerator
54
excludingObject:(
id
)object
55
{
56
if
(
object
==
nil
)
return
enumerator;
57
if
(enumerator ==
nil
)
return
nil
;
58
59
return
[[[
self
alloc] initWithEnumerator:enumerator excludingObject:object] autorelease];
60
}
53
+ (id) enumeratorWithEnumerator:(NSEnumerator *)enumerator {
…
}
61
62
63
- (id)
nextObject
64
{
65
id
result =
nil
;
66
do
67
{
68
result = [
_enumerator
nextObject];
69
}
while
(result ==
_excludeObject
&& result !=
nil
);
70
71
return
result;
72
}
63
- (id)
nextObject
{
…
}
73
74
@end
75
76
77
@implementation
NSEnumerator (OOExcludingObject)
78
79
- (id) ooExcludingObject:(
id
)object
80
{
81
return
[
OOExcludeObjectEnumerator
enumeratorWithEnumerator
:
self
excludingObject
:object];
82
}
79
- (id) ooExcludingObject:(
id
)object {
…
}
83
84
@end
OOExcludeObjectEnumerator.h
nil
return nil
Definition
OOProbabilitySet.m:449
NSEnumerator
OOExcludeObjectEnumerator
Definition
OOExcludeObjectEnumerator.h:32
OOExcludeObjectEnumerator::_enumerator
NSEnumerator * _enumerator
Definition
OOExcludeObjectEnumerator.h:34
-[OOExcludeObjectEnumerator dealloc]
void dealloc()
Definition
OOExcludeObjectEnumerator.m:44
+[OOExcludeObjectEnumerator enumeratorWithEnumerator:excludingObject:]
id enumeratorWithEnumerator:excludingObject:(NSEnumerator *enumerator,[excludingObject] id object)
Definition
OOExcludeObjectEnumerator.m:53
OOExcludeObjectEnumerator::_excludeObject
id _excludeObject
Definition
OOExcludeObjectEnumerator.h:35
-[OOExcludeObjectEnumerator nextObject]
id nextObject()
Definition
OOExcludeObjectEnumerator.m:63
Generated by
1.13.2