Mercurial > projects > dwt-addons
annotate dwtx/dwtxhelper/Collection.d @ 128:8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Add: collection impls.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 17 Aug 2008 02:05:20 +0200 |
parents | 1997315125c0 |
children | 7926b636c282 |
rev | line source |
---|---|
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 module dwtx.dwtxhelper.Collection; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 import dwt.dwthelper.utils; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
5 static import tango.core.Exception; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 static import tango.util.container.CircularList; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
7 static import tango.util.container.HashMap; |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
8 static import tango.util.container.HashSet; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 static import tango.util.container.SortedMap; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
10 static import tango.util.container.more.Vector; |
119 | 11 static import tango.core.Array; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
13 // class AListIterator { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
14 // |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
15 // ArraySeq!(Object) c; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
16 // int i; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
17 // |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
18 // this( ArraySeq!(Object) c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
19 // this.c = c; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
20 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
21 // |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
22 // Object next(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
23 // return c.get(++i); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
24 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
25 // Object previous(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
26 // return c.get(--i); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
27 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
28 // |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
29 // bool hasNext(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
30 // return i+1 < c.size(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
31 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
32 // bool hasPrevious(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
33 // return i > 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
34 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
35 // |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
36 // void remove(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
37 // c.removeAt(i); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
38 // if( i is c.size() ) i--; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
39 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
40 // int nextIndex(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
41 // return i+1; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
42 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
43 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
44 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
45 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
46 interface Iterator { |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
47 public bool hasNext(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
48 public Object next(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
49 public void remove(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
50 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
51 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
52 interface Enumeration { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
53 public bool hasMoreElements(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
54 public Object nextElement(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
55 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
56 |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 interface Collection { |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 public bool add(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
59 public bool add(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 public bool addAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 public void clear(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
62 public bool contains(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 public bool containsAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 public int opEquals(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 public hash_t toHash(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 public bool isEmpty(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 public Iterator iterator(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 public bool remove(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
69 public bool remove(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 public bool removeAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 public bool retainAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 public int size(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 public Object[] toArray(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 public Object[] toArray(Object[] a); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
75 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
76 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
77 public int opApply (int delegate(ref Object value) dg); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
79 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 interface Map { |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
81 interface Entry { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
82 int opEquals(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
83 Object getKey(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
84 Object getValue(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
85 hash_t toHash(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
86 Object setValue(Object value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
87 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
88 public void clear(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
89 public bool containsKey(Object key); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
90 public bool containsKey(String key); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 public bool containsValue(Object value); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
92 public Set entrySet(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 public int opEquals(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
94 public Object get(Object key); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
95 public Object get(String key); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
96 public hash_t toHash(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
97 public bool isEmpty(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
98 public Set keySet(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
99 public Object put(Object key, Object value); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
100 public Object put(String key, Object value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
101 public Object put(Object key, String value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
102 public Object put(String key, String value); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
103 public void putAll(Map t); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
104 public Object remove(Object key); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
105 public Object remove(String key); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
106 public int size(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 public Collection values(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
108 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 // only for D |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 public int opApply (int delegate(ref Object value) dg); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
111 public int opApply (int delegate(ref Object key, ref Object value) dg); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
112 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 interface List : Collection { |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 public void add(int index, Object element); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
116 public bool add(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
117 public bool add(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 public bool addAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
119 public bool addAll(int index, Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 public void clear(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 public bool contains(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 public bool containsAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 public int opEquals(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 public Object get(int index); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
125 public hash_t toHash(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
126 public int indexOf(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
127 public bool isEmpty(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
128 public Iterator iterator(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
129 public int lastIndexOf(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
130 public ListIterator listIterator(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
131 public ListIterator listIterator(int index); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
132 public Object remove(int index); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
133 public bool remove(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
134 public bool remove(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
135 public bool removeAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
136 public bool retainAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
137 public Object set(int index, Object element); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
138 public int size(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
139 public List subList(int fromIndex, int toIndex); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
140 public Object[] toArray(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
141 public Object[] toArray(Object[] a); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
142 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
143 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
144 interface Set : Collection { |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
145 public bool add(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
146 public bool add(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
147 public bool addAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
148 public void clear(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
149 public bool contains(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
150 public bool contains(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
151 public bool containsAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
152 public int opEquals(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
153 public hash_t toHash(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
154 public bool isEmpty(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
155 public Iterator iterator(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
156 public bool remove(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
157 public bool remove(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
158 public bool removeAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
159 public bool retainAll(Collection c); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
160 public int size(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
161 public Object[] toArray(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
162 public Object[] toArray(Object[] a); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
163 public String toString(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
164 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
165 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
166 public int opApply (int delegate(ref Object value) dg); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
167 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
168 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
169 interface SortedSet : Set { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
170 Comparator comparator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
171 Object first(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
172 SortedSet headSet(Object toElement); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
173 Object last(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
174 SortedSet subSet(Object fromElement, Object toElement); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
175 SortedSet tailSet(Object fromElement); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
176 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
177 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
178 interface SortedMap : Map { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
179 Comparator comparator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
180 Object firstKey(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
181 SortedMap headMap(Object toKey); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
182 Object lastKey(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
183 SortedMap subMap(Object fromKey, Object toKey); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
184 SortedMap tailMap(Object fromKey); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
185 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
186 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
187 interface ListIterator : Iterator { |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
188 public void add(Object o); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
189 public bool add(String o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
190 public bool hasNext(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
191 public bool hasPrevious(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
192 public Object next(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
193 public int nextIndex(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
194 public Object previous(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
195 public int previousIndex(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
196 public void remove(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
197 public void set(Object o); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
198 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
199 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
200 /////////////////////////////////////////////////////////////////////////////////////////////////// |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
201 /////////////////////////////////////////////////////////////////////////////////////////////////// |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
202 class MapEntry : Map.Entry { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
203 Map map; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
204 Object key; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
205 private this( Map map, Object key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
206 this.map = map; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
207 this.key = key; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
208 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
209 public override int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
210 if( auto other = cast(MapEntry)o){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
211 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
212 if(( getKey() is null ? other.getKey() is null : getKey() == other.getKey() ) && |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
213 ( getValue() is null ? other.getValue() is null : getValue() == other.getValue() )){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
214 return true; |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
215 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
216 return false; |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
217 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
218 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
219 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
220 public Object getKey(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
221 return key; |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
222 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
223 public Object getValue(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
224 return map.get(key); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
225 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
226 public override hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
227 return ( getKey() is null ? 0 : getKey().toHash() ) ^ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
228 ( getValue() is null ? 0 : getValue().toHash() ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
229 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
230 public Object setValue(Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
231 return map.put( key, value ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
232 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
233 |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
234 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
235 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
236 class HashMap : Map { |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
237 // The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
238 alias tango.util.container.HashMap.HashMap!(Object,Object) MapType; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
239 private MapType map; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
240 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
241 public this(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
242 map = new MapType(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
243 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
244 public this(int initialCapacity){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
245 this(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
246 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
247 public this(int initialCapacity, float loadFactor){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
248 map = new MapType(loadFactor); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
249 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
250 public this(Map m){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
251 this(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
252 putAll(m); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
253 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
254 public void clear(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
255 map.clear(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
256 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
257 public bool containsKey(Object key){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
258 Object v; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
259 return map.get(key, v ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
260 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
261 public bool containsKey(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
262 return containsKey(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
263 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
264 public bool containsValue(Object value){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
265 return map.contains(value); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
266 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
267 public Set entrySet(){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
268 HashSet res = new HashSet(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
269 foreach( k, v; map ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
270 res.add( new MapEntry(this,k)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
271 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
272 return res; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
273 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
274 public override int opEquals(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
275 if( auto other = cast(HashMap) o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
276 if( other.size() !is size() ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
277 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
278 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
279 foreach( k, v; map ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
280 Object vo = other.get(k); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
281 if( v != vo ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
282 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
283 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
284 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
285 return true; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
286 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
287 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
288 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
289 public Object get(Object key){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
290 if( auto v = key in map ){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
291 return *v; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
292 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
293 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
294 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
295 public Object get(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
296 return get(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
297 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
298 public override hash_t toHash(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
299 return super.toHash(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
300 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
301 public bool isEmpty(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
302 return map.isEmpty(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
303 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
304 public Set keySet(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
305 HashSet res = new HashSet(); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
306 foreach( k, v; map ){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
307 res.add(k); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
308 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
309 return res; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
310 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
311 public Object put(Object key, Object value){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
312 Object res = null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
313 if( auto vold = key in map ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
314 res = *vold; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
315 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
316 map[ key ] = value; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
317 return res; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
318 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
319 public Object put(String key, Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
320 return put( stringcast(key), value ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
321 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
322 public Object put(Object key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
323 return put( key, stringcast(value) ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
324 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
325 public Object put(String key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
326 return put( stringcast(key), stringcast(value) ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
327 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
328 public void putAll(Map t){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
329 foreach( k, v; t ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
330 map[k] = v; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
331 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
332 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
333 public Object remove(Object key){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
334 if( auto v = key in map ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
335 Object res = *v; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
336 map.remove(key); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
337 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
338 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
339 map.remove(key); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
340 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
341 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
342 public Object remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
343 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
344 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
345 public int size(){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
346 return map.size(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
347 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
348 public Collection values(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
349 ArrayList res = new ArrayList( size() ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
350 foreach( k, v; map ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
351 res.add( v ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
352 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
353 return res; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
354 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
355 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
356 public int opApply (int delegate(ref Object value) dg){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
357 return map.opApply( dg ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
358 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
359 public int opApply (int delegate(ref Object key, ref Object value) dg){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
360 return map.opApply( dg ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
361 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
362 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
363 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
364 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
365 class Dictionary { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
366 public this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
367 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
368 abstract Enumeration elements(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
369 abstract Object get(Object key); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
370 Object get(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
371 return get(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
372 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
373 abstract bool isEmpty(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
374 abstract Enumeration keys(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
375 abstract Object put(Object key, Object value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
376 public Object put(String key, Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
377 return put(stringcast(key), value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
378 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
379 public Object put(Object key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
380 return put(key, stringcast(value)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
381 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
382 public Object put(String key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
383 return put(stringcast(key), stringcast(value)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
384 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
385 abstract Object remove(Object key); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
386 public Object remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
387 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
388 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
389 abstract int size(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
390 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
391 |
127 | 392 |
393 // no nulls | |
394 // synchronized | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
395 class Hashtable : Dictionary, Map { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
396 |
127 | 397 public Object get(String key){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
398 return super.get(key); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
399 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
400 public Object put(String key, Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
401 return super.put(key, value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
402 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
403 public Object put(Object key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
404 return super.put(key, value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
405 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
406 public Object put(String key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
407 return super.put(key, value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
408 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
409 public Object remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
410 return super.remove(key); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
411 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
412 |
127 | 413 Object[Object] map; |
414 | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
415 // The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
416 public this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
417 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
418 public this(int initialCapacity){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
419 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
420 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
421 public this(int initialCapacity, float loadFactor){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
422 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
423 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
424 public this(Map t){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
425 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
426 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
427 |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
428 class ObjectEnumeration : Enumeration { |
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
429 Object[] values; |
127 | 430 int index = 0; |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
431 this( Object[] values ){ |
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
432 this.values = values; |
127 | 433 } |
434 public bool hasMoreElements(){ | |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
435 return index < values.length; |
127 | 436 } |
437 public Object nextElement(){ | |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
438 Object res = values[index]; |
127 | 439 index++; |
440 return res; | |
441 } | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
442 } |
127 | 443 |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
444 Enumeration elements(){ |
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
445 return new ObjectEnumeration( map.values ); |
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
446 } |
127 | 447 Enumeration keys() { |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
448 return new ObjectEnumeration( map.keys ); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
449 } |
127 | 450 public synchronized void clear(){ |
451 map = null; | |
452 } | |
453 public synchronized bool containsKey(Object key){ | |
454 if( auto v = key in map ){ | |
455 return true; | |
456 } | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
457 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
458 } |
127 | 459 public synchronized bool containsKey(String key){ |
460 return containsKey(stringcast(key)); | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
461 } |
127 | 462 public synchronized bool containsValue(Object value){ |
463 foreach( k, v; map ){ | |
464 if( v == value ){ | |
465 return true; | |
466 } | |
467 } | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
468 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
469 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
470 public Set entrySet(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
471 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
472 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
473 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
474 public int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
475 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
476 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
477 } |
127 | 478 public synchronized Object get(Object key){ |
479 if( auto v = key in map ){ | |
480 return *v; | |
481 } | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
482 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
483 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
484 public hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
485 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
486 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
487 } |
127 | 488 public synchronized bool isEmpty(){ |
489 return map.length is 0; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
490 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
491 public Set keySet(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
492 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
493 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
494 } |
127 | 495 public synchronized Object put(Object key, Object value){ |
496 Object res = null; | |
497 if( auto v = key in map ){ | |
498 res = *v; | |
499 } | |
500 map[ key ] = value; | |
501 return res; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
502 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
503 // public Object put(String key, Object value) |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
504 // public Object put(Object key, String value) |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
505 // public Object put(String key, String value) |
127 | 506 public synchronized void putAll(Map t){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
507 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
508 } |
127 | 509 public synchronized Object remove(Object key){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
510 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
511 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
512 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
513 // public Object remove(String key) |
127 | 514 public synchronized int size(){ |
128
8df1d4193877
Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly.
Frank Benoit <benoit@tionex.de>
parents:
127
diff
changeset
|
515 return map.length; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
516 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
517 public Collection values(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
518 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
519 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
520 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
521 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
522 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
523 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
524 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
525 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
526 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
527 public int opApply (int delegate(ref Object key, ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
528 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
529 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
530 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
531 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
532 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
533 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
534 abstract class AbstractMap : Map { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
535 public this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
536 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
537 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
538 void clear(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
539 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
540 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
541 protected Object clone(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
542 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
543 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
544 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
545 bool containsKey(Object key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
546 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
547 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
548 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
549 bool containsValue(Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
550 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
551 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
552 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
553 abstract Set entrySet(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
554 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
555 public override int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
556 if( Map other = cast(Map)o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
557 return entrySet().opEquals( cast(Object) other.entrySet() ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
558 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
559 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
560 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
561 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
562 Object get(Object key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
563 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
564 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
565 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
566 public override hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
567 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
568 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
569 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
570 bool isEmpty(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
571 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
572 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
573 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
574 Set keySet(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
575 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
576 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
577 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
578 Object put(Object key, Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
579 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
580 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
581 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
582 void putAll(Map t){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
583 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
584 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
585 Object remove(Object key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
586 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
587 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
588 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
589 int size(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
590 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
591 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
592 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
593 String toString(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
594 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
595 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
596 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
597 Collection values(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
598 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
599 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
600 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
601 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
602 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
603 class TreeMap : Map, SortedMap { |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
604 alias tango.util.container.SortedMap.SortedMap!(Object,Object) MapType; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
605 private MapType map; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
606 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
607 public this(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
608 map = new MapType(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
609 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
610 public this(Comparator c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
611 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
612 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
613 public this(Map m){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
614 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
615 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
616 public this(SortedMap m){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
617 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
618 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
619 public void clear(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
620 map.clear(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
621 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
622 Comparator comparator(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
623 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
624 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
625 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
626 public bool containsKey(Object key){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
627 Object v; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
628 return map.get(key, v ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
629 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
630 public bool containsKey(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
631 return containsKey(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
632 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
633 public bool containsValue(Object value){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
634 return map.contains(value); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
635 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
636 public Set entrySet(){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
637 TreeSet res = new TreeSet(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
638 foreach( k, v; map ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
639 res.add( new MapEntry(this,k) ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
640 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
641 return res; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
642 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
643 public override int opEquals(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
644 if( auto other = cast(HashMap) o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
645 if( other.size() !is size() ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
646 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
647 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
648 foreach( k, v; map ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
649 Object vo = other.get(k); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
650 if( v != vo ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
651 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
652 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
653 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
654 return true; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
655 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
656 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
657 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
658 Object firstKey(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
659 foreach( k; map ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
660 return k; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
661 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
662 throw new tango.core.Exception.NoSuchElementException( "TreeMap.firstKey" ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
663 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
664 public Object get(Object key){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
665 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
666 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
667 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
668 public Object get(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
669 return get(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
670 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
671 public override hash_t toHash(){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
672 // http://java.sun.com/j2se/1.4.2/docs/api/java/util/AbstractMap.html#hashCode() |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
673 hash_t res = 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
674 foreach( e; entrySet() ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
675 res += e.toHash(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
676 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
677 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
678 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
679 SortedMap headMap(Object toKey){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
680 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
681 return null; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
682 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
683 public bool isEmpty(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
684 return map.isEmpty(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
685 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
686 public Set keySet(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
687 TreeSet res = new TreeSet(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
688 foreach( k; map ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
689 res.add( k ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
690 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
691 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
692 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
693 Object lastKey(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
694 Object res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
695 foreach( k; map ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
696 res = k; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
697 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
698 if( map.size() ) return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
699 throw new tango.core.Exception.NoSuchElementException( "TreeMap.lastKey" ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
700 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
701 public Object put(Object key, Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
702 if( map.contains(key) ){ // TODO if tango has opIn_r, then use the "in" operator |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
703 Object res = map[key]; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
704 map[key] = value; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
705 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
706 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
707 map[key] = value; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
708 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
709 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
710 public Object put(String key, Object value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
711 return put(stringcast(key), value); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
712 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
713 public Object put(Object key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
714 return put(key, stringcast(value)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
715 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
716 public Object put(String key, String value){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
717 return put(stringcast(key), stringcast(value)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
718 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
719 public void putAll(Map t){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
720 foreach( k, v; t ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
721 put( k, v ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
722 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
723 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
724 public Object remove(Object key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
725 Object res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
726 map.take(key,res); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
727 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
728 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
729 public Object remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
730 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
731 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
732 public int size(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
733 return map.size(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
734 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
735 SortedMap subMap(Object fromKey, Object toKey){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
736 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
737 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
738 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
739 SortedMap tailMap(Object fromKey){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
740 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
741 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
742 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
743 public Collection values(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
744 ArrayList res = new ArrayList( size() ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
745 foreach( k, v; map ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
746 res.add( v ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
747 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
748 return res; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
749 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
750 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
751 public int opApply (int delegate(ref Object value) dg){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
752 return map.opApply( dg ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
753 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
754 public int opApply (int delegate(ref Object key, ref Object value) dg){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
755 return map.opApply( dg ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
756 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
757 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
758 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
759 class HashSet : Set { |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
760 alias tango.util.container.HashSet.HashSet!(Object) SetType; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
761 private SetType set; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
762 |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
763 public this(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
764 set = new SetType(); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
765 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
766 public this(Collection c){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
767 implMissing( __FILE__, __LINE__ ); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
768 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
769 public this(int initialCapacity){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
770 implMissing( __FILE__, __LINE__ ); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
771 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
772 public this(int initialCapacity, float loadFactor){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
773 implMissing( __FILE__, __LINE__ ); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
774 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
775 public bool add(Object o){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
776 return set.add(o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
777 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
778 public bool add(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
779 return add(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
780 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
781 public bool addAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
782 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
783 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
784 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
785 public void clear(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
786 set.clear(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
787 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
788 public bool contains(Object o){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
789 return set.contains(o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
790 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
791 public bool contains(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
792 return contains(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
793 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
794 public bool containsAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
795 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
796 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
797 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
798 public override int opEquals(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
799 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
800 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
801 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
802 public override hash_t toHash(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
803 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
804 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
805 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
806 public bool isEmpty(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
807 return set.isEmpty(); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
808 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
809 class LocalIterator : Iterator { |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
810 SetType.Iterator iter; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
811 Object nextElem; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
812 this( SetType.Iterator iter){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
813 this.iter = iter; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
814 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
815 public bool hasNext(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
816 return iter.next(nextElem); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
817 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
818 public Object next(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
819 return nextElem; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
820 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
821 public void remove(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
822 iter.remove(); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
823 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
824 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
825 public Iterator iterator(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
826 return new LocalIterator(set.iterator()); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
827 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
828 public bool remove(Object o){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
829 return set.remove(o); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
830 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
831 public bool remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
832 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
833 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
834 public bool removeAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
835 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
836 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
837 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
838 public bool retainAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
839 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
840 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
841 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
842 public int size(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
843 return set.size(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
844 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
845 public Object[] toArray(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
846 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
847 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
848 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
849 public Object[] toArray(Object[] a){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
850 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
851 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
852 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
853 public override String toString(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
854 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
855 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
856 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
857 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
858 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
859 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
860 return set.opApply(dg); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
861 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
862 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
863 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
864 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
865 abstract class AbstractCollection : Collection { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
866 this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
867 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
868 bool add(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
869 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
870 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
871 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
872 bool addAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
873 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
874 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
875 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
876 void clear(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
877 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
878 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
879 bool contains(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
880 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
881 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
882 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
883 bool containsAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
884 if( c is null ) throw new NullPointerException(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
885 foreach( o; c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
886 if( !contains(o) ) return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
887 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
888 return true; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
889 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
890 override int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
891 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
892 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
893 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
894 bool isEmpty(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
895 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
896 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
897 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
898 abstract Iterator iterator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
899 override hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
900 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
901 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
902 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
903 bool remove(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
904 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
905 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
906 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
907 bool remove(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
908 return remove(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
909 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
910 bool removeAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
911 if( c is null ) throw new NullPointerException(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
912 bool res = false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
913 foreach( o; c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
914 res |= remove(o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
915 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
916 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
917 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
918 bool retainAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
919 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
920 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
921 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
922 abstract int size(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
923 Object[] toArray(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
924 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
925 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
926 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
927 Object[] toArray(Object[] a){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
928 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
929 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
930 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
931 String toString(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
932 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
933 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
934 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
935 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
936 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
937 abstract class AbstractSet : AbstractCollection, Set { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
938 this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
939 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
940 int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
941 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
942 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
943 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
944 hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
945 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
946 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
947 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
948 bool removeAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
949 return super.removeAll(c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
950 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
951 public abstract bool add(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
952 public abstract bool add(String o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
953 public abstract bool addAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
954 public abstract void clear(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
955 public abstract bool contains(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
956 public abstract bool contains(String o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
957 public abstract bool containsAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
958 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
959 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
960 public abstract bool isEmpty(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
961 public abstract Iterator iterator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
962 public abstract bool remove(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
963 public abstract bool remove(String o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
964 public abstract bool removeAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
965 public abstract bool retainAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
966 public abstract int size(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
967 public abstract Object[] toArray(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
968 public abstract Object[] toArray(Object[] a); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
969 public abstract String toString(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
970 return super.toString(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
971 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
972 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
973 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
974 public abstract int opApply (int delegate(ref Object value) dg); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
975 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
976 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
977 abstract class AbstractList : AbstractCollection, List { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
978 this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
979 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
980 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
981 public abstract void add(int index, Object element); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
982 public abstract bool add(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
983 public abstract bool addAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
984 public abstract bool addAll(int index, Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
985 public abstract void clear(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
986 public abstract bool contains(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
987 public abstract bool containsAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
988 public abstract int opEquals(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
989 public abstract Object get(int index); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
990 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
991 public hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
992 // http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html#hashCode() |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
993 hash_t hashCode = 1; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
994 Iterator i = iterator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
995 while (i.hasNext()) { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
996 Object obj = i.next(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
997 hashCode = 31 * hashCode + (obj is null ? 0 : obj.toHash()); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
998 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
999 return hashCode; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1000 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1001 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1002 public abstract int indexOf(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1003 public abstract bool isEmpty(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1004 public abstract Iterator iterator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1005 public abstract int lastIndexOf(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1006 public abstract ListIterator listIterator(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1007 public abstract ListIterator listIterator(int index); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1008 public abstract Object remove(int index); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1009 protected abstract void removeRange(int fromIndex, int toIndex); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1010 public abstract bool remove(Object o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1011 public abstract bool remove(String o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1012 public abstract bool removeAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1013 public abstract bool retainAll(Collection c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1014 public abstract Object set(int index, Object element); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1015 public abstract List subList(int fromIndex, int toIndex); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1016 public abstract Object[] toArray(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1017 public abstract Object[] toArray(Object[] a); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1018 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1019 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1020 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1021 class TreeSet : AbstractSet, SortedSet { |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1022 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1023 alias tango.util.container.SortedMap.SortedMap!(Object,int) SetType; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1024 private SetType set; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1025 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1026 public this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1027 set = new SetType(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1028 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1029 public this(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1030 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1031 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1032 public this(Comparator c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1033 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1034 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1035 public this(SortedSet){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1036 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1037 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1038 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1039 public bool add(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1040 return set.add(o, 0); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1041 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1042 public bool add(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1043 return add(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1044 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1045 public bool addAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1046 foreach( o; c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1047 add(o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1048 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1049 return true; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1050 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1051 public void clear(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1052 set.clear(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1053 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1054 public bool contains(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1055 return set.containsKey(o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1056 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1057 public bool contains(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1058 return contains(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1059 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1060 public bool containsAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1061 foreach( o; c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1062 if( !contains(o) ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1063 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1064 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1065 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1066 return true; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1067 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1068 public Comparator comparator(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1069 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1070 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1071 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1072 public override int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1073 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1074 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1075 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1076 public Object first(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1077 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1078 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1079 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1080 public override hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1081 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1082 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1083 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1084 public SortedSet headSet(Object toElement){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1085 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1086 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1087 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1088 public bool isEmpty(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1089 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1090 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1091 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1092 public Iterator iterator(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1093 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1094 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1095 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1096 public Object last(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1097 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1098 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1099 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1100 public bool remove(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1101 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1102 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1103 public bool remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1104 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1105 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1106 public bool removeAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1107 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1108 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1109 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1110 public bool retainAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1111 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1112 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1113 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1114 public int size(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1115 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1116 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1117 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1118 public SortedSet subSet(Object fromElement, Object toElement){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1119 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1120 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1121 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1122 public SortedSet tailSet(Object fromElement){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1123 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1124 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1125 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1126 public Object[] toArray(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1127 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1128 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1129 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1130 public Object[] toArray(Object[] a){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1131 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1132 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1133 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1134 public override String toString(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1135 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1136 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1137 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1138 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1139 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1140 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1141 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1142 int localDg( ref Object key, ref int value ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1143 return dg( key ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1144 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1145 return set.opApply(&localDg); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1146 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1147 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1148 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1149 class Vector : AbstractList, List { |
127 | 1150 Object[] vect; |
1151 int used; | |
1152 int capacityIncrement = 32; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1153 public this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1154 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1155 public this(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1156 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1157 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1158 public this(int initialCapacity){ |
127 | 1159 vect.length = initialCapacity; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1160 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1161 public this(int initialCapacity, int capacityIncrement){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1162 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1163 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1164 public void add(int index, Object element){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1165 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1166 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1167 public bool add(Object o){ |
127 | 1168 if( used + 1 >= vect.length ){ |
1169 vect.length = vect.length + capacityIncrement; | |
1170 } | |
1171 vect[used] = o; | |
1172 used++; | |
1173 return true; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1174 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1175 public bool add(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1176 return add(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1177 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1178 public bool addAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1179 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1180 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1181 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1182 public bool addAll(int index, Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1183 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1184 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1185 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1186 public void addElement(Object obj){ |
127 | 1187 add(obj); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1188 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1189 public int capacity(){ |
127 | 1190 return vect.length; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1191 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1192 public void clear(){ |
127 | 1193 used = 0; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1194 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1195 public Object clone(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1196 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1197 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1198 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1199 public bool contains(Object elem){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1200 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1201 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1202 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1203 public bool containsAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1204 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1205 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1206 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1207 public void copyInto(Object[] anArray){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1208 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1209 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1210 public Object elementAt(int index){ |
127 | 1211 return get(index); |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1212 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1213 public Enumeration elements(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1214 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1215 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1216 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1217 public void ensureCapacity(int minCapacity){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1218 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1219 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1220 public int opEquals(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1221 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1222 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1223 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1224 public Object firstElement(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1225 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1226 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1227 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1228 public Object get(int index){ |
127 | 1229 if( index >= used || index < 0 ){ |
1230 throw new tango.core.Exception.ArrayBoundsException( __FILE__, __LINE__ ); | |
1231 } | |
1232 return vect[index]; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1233 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1234 public hash_t toHash(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1235 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1236 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1237 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1238 public int indexOf(Object elem){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1239 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1240 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1241 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1242 public int indexOf(Object elem, int index){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1243 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1244 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1245 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1246 public void insertElementAt(Object obj, int index){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1247 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1248 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1249 public bool isEmpty(){ |
127 | 1250 return used is 0; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1251 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1252 public Iterator iterator(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1253 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1254 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1255 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1256 public Object lastElement(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1257 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1258 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1259 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1260 public int lastIndexOf(Object elem){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1261 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1262 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1263 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1264 public int lastIndexOf(Object elem, int index){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1265 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1266 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1267 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1268 public ListIterator listIterator(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1269 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1270 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1271 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1272 public ListIterator listIterator(int index){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1273 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1274 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1275 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1276 public Object remove(int index){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1277 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1278 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1279 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1280 public bool remove(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1281 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1282 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1283 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1284 public bool remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1285 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1286 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1287 public bool removeAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1288 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1289 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1290 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1291 public void removeAllElements(){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1292 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1293 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1294 public bool removeElement(Object obj){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1295 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1296 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1297 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1298 public void removeElementAt(int index){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1299 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1300 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1301 protected void removeRange(int fromIndex, int toIndex){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1302 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1303 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1304 public bool retainAll(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1305 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1306 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1307 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1308 public Object set(int index, Object element){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1309 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1310 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1311 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1312 public void setElementAt(Object obj, int index){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1313 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1314 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1315 public void setSize(int newSize){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1316 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1317 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1318 public int size(){ |
127 | 1319 return used; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1320 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1321 public List subList(int fromIndex, int toIndex){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1322 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1323 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1324 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1325 public Object[] toArray(){ |
127 | 1326 return vect[ 0 .. used ].dup; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1327 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1328 public Object[] toArray(Object[] a){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1329 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1330 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1331 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1332 public String toString(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1333 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1334 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1335 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1336 public void trimToSize(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1337 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1338 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1339 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1340 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1341 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1342 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1343 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1344 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1345 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1346 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1347 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1348 class Stack : Vector { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1349 this(){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1350 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1351 void add(int index, Object element){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1352 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1353 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1354 bool add(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1355 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1356 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1357 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1358 public bool add(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1359 return add(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1360 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1361 bool addAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1362 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1363 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1364 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1365 bool addAll(int index, Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1366 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1367 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1368 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1369 void addElement(Object obj){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1370 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1371 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1372 int capacity(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1373 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1374 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1375 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1376 void clear(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1377 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1378 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1379 Object clone(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1380 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1381 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1382 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1383 bool contains(Object elem){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1384 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1385 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1386 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1387 bool containsAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1388 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1389 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1390 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1391 void copyInto(Object[] anArray){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1392 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1393 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1394 Object elementAt(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1395 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1396 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1397 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1398 // Enumeration elements(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1399 // implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1400 // return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1401 // } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1402 void ensureCapacity(int minCapacity){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1403 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1404 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1405 int opEquals(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1406 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1407 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1408 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1409 Object firstElement(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1410 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1411 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1412 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1413 Object get(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1414 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1415 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1416 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1417 hash_t toHash(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1418 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1419 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1420 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1421 int indexOf(Object elem){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1422 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1423 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1424 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1425 int indexOf(Object elem, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1426 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1427 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1428 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1429 void insertElementAt(Object obj, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1430 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1431 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1432 bool isEmpty(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1433 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1434 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1435 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1436 Iterator iterator(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1437 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1438 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1439 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1440 Object lastElement(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1441 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1442 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1443 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1444 int lastIndexOf(Object elem){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1445 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1446 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1447 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1448 int lastIndexOf(Object elem, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1449 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1450 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1451 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1452 ListIterator listIterator(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1453 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1454 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1455 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1456 ListIterator listIterator(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1457 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1458 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1459 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1460 Object remove(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1461 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1462 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1463 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1464 bool remove(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1465 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1466 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1467 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1468 public bool remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1469 return remove(stringcast(key)); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1470 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1471 bool removeAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1472 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1473 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1474 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1475 void removeAllElements(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1476 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1477 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1478 bool removeElement(Object obj){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1479 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1480 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1481 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1482 void removeElementAt(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1483 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1484 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1485 protected void removeRange(int fromIndex, int toIndex){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1486 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1487 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1488 bool retainAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1489 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1490 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1491 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1492 Object set(int index, Object element){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1493 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1494 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1495 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1496 void setElementAt(Object obj, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1497 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1498 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1499 void setSize(int newSize){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1500 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1501 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1502 int size(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1503 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1504 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1505 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1506 List subList(int fromIndex, int toIndex){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1507 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1508 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1509 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1510 Object[] toArray(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1511 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1512 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1513 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1514 Object[] toArray(Object[] a){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1515 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1516 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1517 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1518 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1519 // from Stack |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1520 String toString(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1521 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1522 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1523 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1524 void trimToSize(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1525 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1526 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1527 bool empty(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1528 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1529 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1530 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1531 Object peek(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1532 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1533 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1534 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1535 Object pop(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1536 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1537 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1538 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1539 Object push(Object item){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1540 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1541 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1542 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1543 int search(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1544 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1545 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1546 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1547 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1548 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1549 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1550 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1551 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1552 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1553 |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1554 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1555 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1556 class LinkedList : List { |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1557 alias tango.util.container.CircularList.CircularList!(Object) ListType; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1558 private ListType list; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1559 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1560 this(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1561 list = new ListType(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1562 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1563 this( Collection c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1564 this(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1565 addAll(c); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1566 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1567 void add(int index, Object element){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1568 list.addAt(index,element); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1569 return true; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1570 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1571 bool add(Object o){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1572 list.add(o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1573 return true; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1574 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1575 public bool add(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1576 return add(stringcast(o)); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1577 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1578 bool addAll(Collection c){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1579 if( c is null ) throw new NullPointerException(); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1580 bool res = false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1581 foreach( o; c ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1582 res |= add( o ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1583 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1584 return res; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1585 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1586 bool addAll(int index, Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1587 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1588 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1589 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1590 void addFirst(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1591 list.prepend( o ); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1592 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1593 void addLast(Object o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1594 list.append( o ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1595 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1596 // void addElement(Object obj){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1597 // implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1598 // } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1599 int capacity(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1600 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1601 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1602 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1603 void clear(){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1604 list.clear(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1605 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1606 Object clone(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1607 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1608 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1609 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1610 bool contains(Object elem){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1611 return list.contains(elem); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1612 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1613 bool containsAll(Collection c){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1614 foreach(o; c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1615 if( !list.contains(o)) return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1616 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1617 return true; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1618 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1619 void copyInto(Object[] anArray){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1620 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1621 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1622 Object elementAt(int index){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1623 return list.get(index); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1624 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1625 // Enumeration elements(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1626 // implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1627 // return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1628 // } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1629 void ensureCapacity(int minCapacity){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1630 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1631 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1632 int opEquals(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1633 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1634 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1635 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1636 Object firstElement(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1637 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1638 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1639 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1640 Object get(int index){ |
116 | 1641 return list.get(index); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1642 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1643 hash_t toHash(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1644 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1645 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1646 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1647 int indexOf(Object elem){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1648 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1649 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1650 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1651 int indexOf(Object elem, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1652 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1653 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1654 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1655 void insertElementAt(Object obj, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1656 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1657 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1658 bool isEmpty(){ |
116 | 1659 return list.isEmpty(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1660 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1661 Iterator iterator(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1662 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1663 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1664 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1665 Object lastElement(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1666 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1667 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1668 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1669 int lastIndexOf(Object elem){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1670 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1671 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1672 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1673 int lastIndexOf(Object elem, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1674 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1675 return 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1676 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1677 ListIterator listIterator(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1678 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1679 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1680 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1681 ListIterator listIterator(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1682 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1683 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1684 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1685 Object remove(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1686 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1687 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1688 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1689 bool remove(Object o){ |
116 | 1690 return list.remove(o,false) !is 0; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1691 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1692 public bool remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1693 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1694 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1695 bool removeAll(Collection c){ |
116 | 1696 bool res = false; |
1697 foreach( o; c){ | |
1698 res |= list.remove(o,false) !is 0; | |
1699 } | |
1700 return res; | |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1701 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1702 void removeAllElements(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1703 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1704 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1705 Object removeFirst(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1706 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1707 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1708 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1709 Object removeLast(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1710 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1711 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1712 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1713 bool removeElement(Object obj){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1714 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1715 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1716 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1717 void removeElementAt(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1718 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1719 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1720 protected void removeRange(int fromIndex, int toIndex){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1721 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1722 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1723 bool retainAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1724 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1725 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1726 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1727 Object set(int index, Object element){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1728 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1729 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1730 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1731 void setElementAt(Object obj, int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1732 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1733 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1734 void setSize(int newSize){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1735 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1736 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1737 int size(){ |
114 | 1738 return list.size(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1739 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1740 List subList(int fromIndex, int toIndex){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1741 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1742 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1743 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1744 Object[] toArray(){ |
121
c0304616ea23
Fix: tango assertion error, see tango ticket 1237
Frank Benoit <benoit@tionex.de>
parents:
119
diff
changeset
|
1745 if( list.size() is 0 ) return null; // workaround tango ticket 1237 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1746 return list.toArray(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1747 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1748 Object[] toArray(Object[] a){ |
121
c0304616ea23
Fix: tango assertion error, see tango ticket 1237
Frank Benoit <benoit@tionex.de>
parents:
119
diff
changeset
|
1749 if( list.size() is 0 ) return a[0 .. 0]; // workaround tango ticket 1237 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1750 return list.toArray( a ); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1751 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1752 String toString(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1753 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1754 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1755 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1756 void trimToSize(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1757 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1758 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1759 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1760 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1761 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1762 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1763 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1764 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1765 |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1766 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1767 |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1768 class ArrayList : AbstractList, List { |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1769 private Object[] data; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1770 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1771 this(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1772 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1773 this(int size){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1774 data.length = size; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1775 data.length = 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1776 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1777 this(Collection){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1778 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1779 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1780 void add(int index, Object element){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1781 data.length = data.length +1; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1782 System.arraycopy( data, index, data, index+1, data.length - index -1 ); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1783 data[index] = element; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1784 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1785 bool add(Object o){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1786 data ~= o; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1787 return true; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1788 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1789 public bool add(String o){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1790 return add(stringcast(o)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1791 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1792 bool addAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1793 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1794 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1795 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1796 bool addAll(int index, Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1797 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1798 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1799 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1800 void clear(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1801 data.length = 0; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1802 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1803 ArrayList clone(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1804 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1805 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1806 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1807 bool contains(Object o){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1808 foreach( v; data ){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1809 if( o is v ){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1810 return true; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1811 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1812 if(( o is null ) || ( v is null )){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1813 continue; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1814 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1815 if( o == v ){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1816 return true; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1817 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1818 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1819 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1820 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1821 bool containsAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1822 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1823 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1824 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1825 int opEquals(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1826 if( auto other = cast(ArrayList)o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1827 if( data.length !is other.data.length ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1828 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1829 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1830 for( int i = 0; i < data.length; i++ ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1831 if( data[i] is other.data[i] ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1832 continue; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1833 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1834 if(( data[i] is null ) || ( other.data[i] is null )){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1835 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1836 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1837 if( data[i] == other.data[i] ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1838 continue; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1839 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1840 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1841 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1842 return true; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1843 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1844 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1845 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1846 Object get(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1847 return data[index]; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1848 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1849 public override hash_t toHash(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1850 return super.toHash(); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1851 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1852 int indexOf(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1853 foreach( i, v; data ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1854 if( data[i] is o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1855 return i; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1856 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1857 if(( data[i] is null ) || ( o is null )){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1858 continue; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1859 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1860 if( data[i] == o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1861 return i; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1862 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1863 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1864 return -1; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1865 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1866 bool isEmpty(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1867 return data.length is 0; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1868 } |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1869 class LocalIterator : Iterator{ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1870 int idx = 0; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1871 public this(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1872 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1873 public bool hasNext(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1874 return idx < data.length; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1875 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1876 public Object next(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1877 Object res = data[idx]; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1878 idx++; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1879 return res; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1880 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1881 public void remove(){ |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1882 implMissing( __FILE__, __LINE__ ); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1883 this.outer.remove(idx); |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1884 idx--; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1885 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1886 } |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1887 |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1888 Iterator iterator(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1889 return new LocalIterator(); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1890 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1891 int lastIndexOf(Object o){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1892 foreach_reverse( i, v; data ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1893 if( data[i] is o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1894 return i; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1895 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1896 if(( data[i] is null ) || ( o is null )){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1897 continue; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1898 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1899 if( data[i] == o ){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1900 return i; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1901 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1902 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1903 return -1; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1904 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1905 ListIterator listIterator(){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1906 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1907 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1908 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1909 ListIterator listIterator(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1910 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1911 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1912 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1913 Object remove(int index){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1914 Object res = data[index]; |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1915 System.arraycopy( data, index+1, data, index, data.length - index - 1 ); |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1916 data.length = data.length -1; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1917 return res; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1918 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1919 bool remove(Object o){ |
119 | 1920 return tango.core.Array.remove(data, o) !is 0; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1921 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1922 public bool remove(String key){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1923 return remove(stringcast(key)); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1924 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1925 bool removeAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1926 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1927 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1928 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1929 bool retainAll(Collection c){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1930 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1931 return false; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1932 } |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1933 protected void removeRange(int fromIndex, int toIndex){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1934 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1935 } |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1936 Object set(int index, Object element){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1937 Object res = data[index]; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1938 data[index] = element; |
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1939 return res; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1940 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1941 int size(){ |
101
1082a0fc2bb8
First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents:
100
diff
changeset
|
1942 return data.length; |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1943 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1944 List subList(int fromIndex, int toIndex){ |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1945 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1946 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1947 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1948 Object[] toArray(){ |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1949 return data.dup; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1950 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1951 Object[] toArray(Object[] a){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1952 if( data.length <= a.length ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1953 a[ 0 .. data.length ] = data; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1954 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1955 else{ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1956 return data.dup; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1957 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1958 if( data.length < a.length ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1959 a[data.length] = null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1960 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1961 return a; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1962 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1963 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1964 // only for D |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1965 public int opApply (int delegate(ref Object value) dg){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1966 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1967 return 0; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1968 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1969 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1970 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1971 class Arrays { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1972 public static bool equals(Object[] a, Object[] b){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1973 if( a.length !is b.length ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1974 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1975 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1976 for( int i = 0; i < a.length; i++ ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1977 if( a[i] is null && b[i] is null ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1978 continue; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1979 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1980 if( a[i] !is null && b[i] !is null && a[i] == b[i] ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1981 continue; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1982 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1983 return false; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1984 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1985 return true; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1986 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1987 static List asList(Object[] a) { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1988 if( a.length is 0 ) return Collections.EMPTY_LIST; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1989 ArrayList res = new ArrayList( a.length ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1990 foreach( o; a ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1991 res.add(o); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1992 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1993 return res; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1994 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1995 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1996 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1997 class Collections { |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1998 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
1999 private static List EMPTY_LIST_; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2000 public static List EMPTY_LIST(){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2001 if( EMPTY_LIST_ is null ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2002 synchronized(Collections.classinfo ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2003 if( EMPTY_LIST_ is null ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2004 EMPTY_LIST_ = new ArrayList(0); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2005 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2006 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2007 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2008 return EMPTY_LIST_; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2009 } |
106 | 2010 private static Map EMPTY_MAP_; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2011 public static Map EMPTY_MAP(){ |
106 | 2012 if( EMPTY_MAP_ is null ){ |
2013 synchronized(Collections.classinfo ){ | |
2014 if( EMPTY_MAP_ is null ){ | |
2015 EMPTY_MAP_ = new TreeMap(); | |
2016 } | |
2017 } | |
2018 } | |
2019 return EMPTY_MAP_; | |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2020 } |
106 | 2021 private static Set EMPTY_SET_; |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2022 public static Set EMPTY_SET(){ |
106 | 2023 if( EMPTY_SET_ is null ){ |
2024 synchronized(Collections.classinfo ){ | |
2025 if( EMPTY_SET_ is null ){ | |
2026 EMPTY_SET_ = new TreeSet(); | |
2027 } | |
2028 } | |
2029 } | |
2030 return EMPTY_SET_; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2031 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2032 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2033 public static List unmodifiableList( List list ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2034 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2035 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2036 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2037 public static Map unmodifiableMap( Map list ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2038 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2039 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2040 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2041 public static Set unmodifiableSet( Set list ){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2042 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2043 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2044 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2045 public static Set singleton( Object o ){ |
106 | 2046 TreeSet res = new TreeSet(); |
2047 res.add(o); | |
2048 return res; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2049 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2050 public static void sort(List list){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2051 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2052 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2053 public static void sort(List list, Comparator c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2054 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2055 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2056 |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2057 static Collection synchronizedCollection(Collection c){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2058 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2059 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2060 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2061 static List synchronizedList(List list){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2062 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2063 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2064 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2065 static Map synchronizedMap(Map m){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2066 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2067 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2068 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2069 static Set synchronizedSet(Set s){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2070 implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2071 return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2072 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2073 // static SortedMap synchronizedSortedMap(SortedMap m){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2074 // implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2075 // return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2076 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2077 // static SortedSet synchronizedSortedSet(SortedSet s){ |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2078 // implMissing( __FILE__, __LINE__ ); |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2079 // return null; |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2080 // } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2081 static void reverse(List list) { |
106 | 2082 Object[] data = list.toArray(); |
2083 for( int idx = 0; idx < data.length; idx++ ){ | |
2084 list.set( data.length -1 -idx, data[idx] ); | |
2085 } | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2086 } |
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
101
diff
changeset
|
2087 static Enumeration enumeration(Collection c){ |
100
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2088 implMissing( __FILE__, __LINE__ ); |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2089 return null; |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2090 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2091 } |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2092 |
86617aa6b5dd
More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2093 |