Mercurial > projects > dwt2
comparison org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ObservableSet.d @ 85:6be48cf9f95c
Work on databinding
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Apr 2009 13:54:50 +0200 |
parents | 383ce7bd736b |
children |
comparison
equal
deleted
inserted
replaced
84:fcf926c91ca4 | 85:6be48cf9f95c |
---|---|
39 * @since 1.0 | 39 * @since 1.0 |
40 * | 40 * |
41 */ | 41 */ |
42 public abstract class ObservableSet : AbstractObservable , | 42 public abstract class ObservableSet : AbstractObservable , |
43 IObservableSet { | 43 IObservableSet { |
44 | 44 // DWT start: additional methods in Set |
45 public bool add(String o) { | |
46 return add(stringcast(o)); | |
47 } | |
48 public bool remove(String o) { | |
49 return remove(stringcast(o)); | |
50 } | |
51 public bool contains(String o) { | |
52 return contains(stringcast(o)); | |
53 } | |
54 public int opApply (int delegate(ref Object value) dg){ | |
55 auto it = iterator(); | |
56 while(it.hasNext()){ | |
57 auto v = it.next(); | |
58 int res = dg( v ); | |
59 if( res ) return res; | |
60 } | |
61 return 0; | |
62 } | |
63 | |
64 // DWT end: additional methods in Set | |
45 protected Set wrappedSet; | 65 protected Set wrappedSet; |
46 | 66 |
47 private bool stale = false; | 67 private bool stale = false; |
48 | 68 |
49 protected Object elementType; | 69 protected Object elementType; |
81 public bool containsAll(Collection c) { | 101 public bool containsAll(Collection c) { |
82 getterCalled(); | 102 getterCalled(); |
83 return wrappedSet.containsAll(c); | 103 return wrappedSet.containsAll(c); |
84 } | 104 } |
85 | 105 |
86 public override bool opEquals(Object o) { | 106 public override equals_t opEquals(Object o) { |
87 getterCalled(); | 107 getterCalled(); |
88 return wrappedSet.equals(o); | 108 return wrappedSet.opEquals(o); |
89 } | 109 } |
90 | 110 |
91 public int hashCode() { | 111 public hash_t toHash() { |
92 getterCalled(); | 112 getterCalled(); |
93 return wrappedSet.hashCode(); | 113 return wrappedSet.toHash(); |
94 } | 114 } |
95 | 115 |
96 public bool isEmpty() { | 116 public bool isEmpty() { |
97 getterCalled(); | 117 getterCalled(); |
98 return wrappedSet.isEmpty(); | 118 return wrappedSet.isEmpty(); |