Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSHashTable.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSHashTable; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSEnumerator; | |
19 import dwt.internal.cocoa.NSInteger; | |
20 import dwt.internal.cocoa.NSObject; | |
21 import dwt.internal.cocoa.NSPointerFunctions; | |
22 import dwt.internal.cocoa.NSSet; | |
23 import dwt.internal.cocoa.OS; | |
24 import objc = dwt.internal.objc.runtime; | |
25 | |
26 public class NSHashTable : NSObject | |
27 { | |
28 | |
29 public this () | |
30 { | |
31 super(); | |
32 } | |
33 | |
34 public this (objc.id id) | |
35 { | |
36 super(id); | |
37 } | |
38 | |
39 public void addObject (id object) | |
40 { | |
41 OS.objc_msgSend(this.id, OS.sel_addObject_1, object !is null ? object.id : null); | |
42 } | |
43 | |
44 public NSArray allObjects () | |
45 { | |
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_allObjects); | |
47 return result !is null ? new NSArray(result) : null; | |
48 } | |
49 | |
50 public id anyObject () | |
51 { | |
52 objc.id result = OS.objc_msgSend(this.id, OS.sel_anyObject); | |
53 return result !is null ? new id(result) : null; | |
54 } | |
55 | |
56 public bool containsObject (id anObject) | |
57 { | |
58 return OS.objc_msgSend(this.id, OS.sel_containsObject_1, anObject !is null ? anObject.id : null) !is null; | |
59 } | |
60 | |
61 public NSUInteger count () | |
62 { | |
63 return OS.objc_msgSend(this.id, OS.sel_count); | |
64 } | |
65 | |
66 public static id hashTableWithOptions (NSPointerFunctionsOptions options) | |
67 { | |
68 objc.id result = OS.objc_msgSend(OS.class_NSHashTable, OS.sel_hashTableWithOptions_1, options); | |
69 return result !is null ? new id(result) : null; | |
70 } | |
71 | |
72 public static id hashTableWithWeakObjects () | |
73 { | |
74 objc.id result = OS.objc_msgSend(OS.class_NSHashTable, OS.sel_hashTableWithWeakObjects); | |
75 return result !is null ? new id(result) : null; | |
76 } | |
77 | |
78 public id initWithOptions (NSPointerFunctionsOptions options, NSUInteger initialCapacity) | |
79 { | |
80 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithOptions_1capacity_1, options, initialCapacity); | |
81 return result !is null ? new id(result) : null; | |
82 } | |
83 | |
84 public id initWithPointerFunctions (NSPointerFunctions functions, NSUInteger initialCapacity) | |
85 { | |
86 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithPointerFunctions_1capacity_1, functions !is null ? functions.id : null, | |
87 initialCapacity); | |
88 return result !is null ? new id(result) : null; | |
89 } | |
90 | |
91 public void intersectHashTable (NSHashTable other) | |
92 { | |
93 OS.objc_msgSend(this.id, OS.sel_intersectHashTable_1, other !is null ? other.id : null); | |
94 } | |
95 | |
96 public bool intersectsHashTable (NSHashTable other) | |
97 { | |
98 return OS.objc_msgSend(this.id, OS.sel_intersectsHashTable_1, other !is null ? other.id : null) !is null; | |
99 } | |
100 | |
101 public bool isEqualToHashTable (NSHashTable other) | |
102 { | |
103 return OS.objc_msgSend(this.id, OS.sel_isEqualToHashTable_1, other !is null ? other.id : null) !is null; | |
104 } | |
105 | |
106 public bool isSubsetOfHashTable (NSHashTable other) | |
107 { | |
108 return OS.objc_msgSend(this.id, OS.sel_isSubsetOfHashTable_1, other !is null ? other.id : null) !is null; | |
109 } | |
110 | |
111 public id member (id object) | |
112 { | |
113 objc.id result = OS.objc_msgSend(this.id, OS.sel_member_1, object !is null ? object.id : null); | |
114 return result !is null ? new id(result) : null; | |
115 } | |
116 | |
117 public void minusHashTable (NSHashTable other) | |
118 { | |
119 OS.objc_msgSend(this.id, OS.sel_minusHashTable_1, other !is null ? other.id : null); | |
120 } | |
121 | |
122 public NSEnumerator objectEnumerator () | |
123 { | |
124 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator); | |
125 return result !is null ? new NSEnumerator(result) : null; | |
126 } | |
127 | |
128 public NSPointerFunctions pointerFunctions () | |
129 { | |
130 objc.id result = OS.objc_msgSend(this.id, OS.sel_pointerFunctions); | |
131 return result !is null ? new NSPointerFunctions(result) : null; | |
132 } | |
133 | |
134 public void removeAllObjects () | |
135 { | |
136 OS.objc_msgSend(this.id, OS.sel_removeAllObjects); | |
137 } | |
138 | |
139 public void removeObject (id object) | |
140 { | |
141 OS.objc_msgSend(this.id, OS.sel_removeObject_1, object !is null ? object.id : null); | |
142 } | |
143 | |
144 public NSSet setRepresentation () | |
145 { | |
146 objc.id result = OS.objc_msgSend(this.id, OS.sel_setRepresentation); | |
147 return result !is null ? new NSSet(result) : null; | |
148 } | |
149 | |
150 public void unionHashTable (NSHashTable other) | |
151 { | |
152 OS.objc_msgSend(this.id, OS.sel_unionHashTable_1, other !is null ? other.id : null); | |
153 } | |
154 | |
155 } |