My favorites
▼
|
Sign in
sibirjak
Russischer Bär source code repository
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
asperform
/
com
/
sibirjak
/
asperform
/
collectiontests
/
examples
/
set
/
SetRaw.as
r27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.sibirjak.asperform.collectiontests.examples.set {
import flash.utils.Dictionary;
public class SetRaw {
public var map : Dictionary;
public var stringMap : Object;
public var size : uint;
public function SetRaw() {
map = new Dictionary();
stringMap = new Object();
}
public function add(item : *) : void {
if (item is String) {
stringMap[item] = true;
} else {
map[item] = true;
}
size++;
}
public function has(item : *) : Boolean {
if (item is String) {
return stringMap[item] !== undefined;
} else {
return map[item] !== undefined;
}
}
public function remove(item : *) : void {
if (item is String) {
if (stringMap[item] === undefined) return;
delete stringMap[item];
} else {
if (map[item] === undefined) return;
delete map[item];
}
size--;
}
}
}
Show details
Hide details
Change log
r11
by jens.struwe on Apr 29, 2010
Diff
[DEV] Set example
Go to:
...ectiontests/CollectionTests.mxml
...iontests/examples/SetRawTests.as
...orm/collectiontests/examples/set
...tiontests/examples/set/SetRaw.as
...tests/examples/set/SetRawTest.as
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 867 bytes, 44 lines
View raw file
Powered by
Google Project Hosting