annotate dwtx/dwtxhelper/Collection.d @ 177:21c77bcb7887

add impl
author Frank Benoit <benoit@tionex.de>
date Fri, 12 Sep 2008 18:50:33 +0200
parents c6d7b1ea700b
children 9008cb2f47c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
35f1d208f3c3 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 116
diff changeset
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);
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
122 public bool contains(String o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 public bool containsAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 public int opEquals(Object o);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
125 public Object get(int index);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 public hash_t toHash();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 public int indexOf(Object o);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 public bool isEmpty();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 public Iterator iterator();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 public int lastIndexOf(Object o);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131 public ListIterator listIterator();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 public ListIterator listIterator(int index);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133 public Object remove(int index);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134 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
135 public bool remove(String o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136 public bool removeAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
137 public bool retainAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 public Object set(int index, Object element);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139 public int size();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
140 public List subList(int fromIndex, int toIndex);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
141 public Object[] toArray();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142 public Object[] toArray(Object[] a);
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
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
145 interface Set : Collection {
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
146 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
147 public bool add(String o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
148 public bool addAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
149 public void clear();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
150 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
151 public bool contains(String o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
152 public bool containsAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
153 public int opEquals(Object o);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
154 public hash_t toHash();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
155 public bool isEmpty();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
156 public Iterator iterator();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
157 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
158 public bool remove(String o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
159 public bool removeAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
160 public bool retainAll(Collection c);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
161 public int size();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
162 public Object[] toArray();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
163 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
164 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
165
04b47443bb01 Reworked the collection 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 // 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
167 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
168 }
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
169
04b47443bb01 Reworked the collection 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 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
171 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
172 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
173 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
174 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
175 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
176 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
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
04b47443bb01 Reworked the collection 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 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
180 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
181 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
182 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
183 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
184 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
185 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
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
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
188 interface ListIterator : Iterator {
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
189 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
190 public bool add(String o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
191 public bool hasNext();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
192 public bool hasPrevious();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
193 public Object next();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
194 public int nextIndex();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
195 public Object previous();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
196 public int previousIndex();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
197 public void remove();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
198 public void set(Object o);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
199 }
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
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 ///////////////////////////////////////////////////////////////////////////////////////////////////
04b47443bb01 Reworked the collection 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 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
204 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
205 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 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
207 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
208 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
209 }
04b47443bb01 Reworked the collection 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 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
211 if( auto other = cast(MapEntry)o){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
212
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
213 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
214 ( 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
215 return true;
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
216 }
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
217 return false;
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
218 }
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
219 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
220 }
04b47443bb01 Reworked the collection 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 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
222 return key;
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
223 }
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
224 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
225 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
226 }
04b47443bb01 Reworked the collection 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 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
228 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
229 ( 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
230 }
04b47443bb01 Reworked the collection 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 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
232 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
233 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
234
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
235 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
236
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
237 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
238 // 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
239 alias tango.util.container.HashMap.HashMap!(Object,Object) MapType;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
240 private MapType map;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
241
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
242 public this(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
243 map = new MapType();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
244 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
245 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
246 this();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
247 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
248 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
249 map = new MapType(loadFactor);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
250 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
251 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
252 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
253 putAll(m);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
254 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
255 public void clear(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
256 map.clear();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
257 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
258 public bool containsKey(Object key){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
259 Object v;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
260 return map.get(key, v );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
261 }
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
262 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
263 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
264 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
265 public bool containsValue(Object value){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
266 return map.contains(value);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
267 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
268 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
269 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
270 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
271 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
272 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
273 return res;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
274 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
275 public override int opEquals(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
276 if( auto other = cast(HashMap) o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
277 if( other.size() !is size() ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
278 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
279 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
280 foreach( k, v; map ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
281 Object vo = other.get(k);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
282 if( v != vo ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
283 return false;
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 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
286 return true;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
287 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
288 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
289 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
290 public Object get(Object key){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
291 if( auto v = key in map ){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
292 return *v;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
293 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
294 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
295 }
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
296 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
297 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
298 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
299 public override hash_t toHash(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
300 return super.toHash();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
301 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
302 public bool isEmpty(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
303 return map.isEmpty();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
304 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
305 public Set keySet(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
306 HashSet res = new HashSet();
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
307 foreach( k, v; map ){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
308 res.add(k);
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
309 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
310 return res;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
311 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
312 public Object put(Object key, Object value){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
313 Object res = null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
314 if( auto vold = key in map ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
315 res = *vold;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
316 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
317 map[ key ] = value;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
318 return res;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
319 }
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
320 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
321 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
322 }
04b47443bb01 Reworked the collection 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 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
324 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
325 }
04b47443bb01 Reworked the collection 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 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
327 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
328 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
329 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
330 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
331 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
332 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
333 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
334 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
335 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
336 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
337 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
338 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
339 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
340 map.remove(key);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
341 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
342 }
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
343 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
344 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
345 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
346 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
347 return map.size();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
348 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
349 public Collection values(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
350 ArrayList res = new ArrayList( size() );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
351 foreach( k, v; map ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
352 res.add( v );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
353 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
354 return res;
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
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
357 public int opApply (int delegate(ref Object value) dg){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
358 return map.opApply( dg );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
359 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
360 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
361 return map.opApply( dg );
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 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
365
159
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
366 class IdentityHashMap : Map {
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
367 alias tango.util.container.HashMap.HashMap!(Object,Object) MapType;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
368 private MapType map;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
369
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
370 public this(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
371 implMissing(__FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
372 map = new MapType();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
373 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
374 public this(int initialCapacity){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
375 implMissing(__FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
376 this();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
377 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
378 public this(int initialCapacity, float loadFactor){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
379 implMissing(__FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
380 map = new MapType(loadFactor);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
381 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
382 public this(Map m){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
383 implMissing(__FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
384 this();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
385 putAll(m);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
386 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
387 public void clear(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
388 map.clear();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
389 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
390 public bool containsKey(Object key){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
391 Object v;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
392 return map.get(key, v );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
393 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
394 public bool containsKey(String key){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
395 return containsKey(stringcast(key));
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
396 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
397 public bool containsValue(Object value){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
398 return map.contains(value);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
399 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
400 public Set entrySet(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
401 HashSet res = new HashSet();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
402 foreach( k, v; map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
403 res.add( new MapEntry(this,k));
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
404 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
405 return res;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
406 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
407 public override int opEquals(Object o){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
408 if( auto other = cast(HashMap) o ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
409 if( other.size() !is size() ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
410 return false;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
411 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
412 foreach( k, v; map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
413 Object vo = other.get(k);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
414 if( v != vo ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
415 return false;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
416 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
417 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
418 return true;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
419 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
420 return false;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
421 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
422 public Object get(Object key){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
423 if( auto v = key in map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
424 return *v;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
425 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
426 return null;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
427 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
428 public Object get(String key){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
429 return get(stringcast(key));
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
430 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
431 public override hash_t toHash(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
432 return super.toHash();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
433 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
434 public bool isEmpty(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
435 return map.isEmpty();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
436 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
437 public Set keySet(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
438 HashSet res = new HashSet();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
439 foreach( k, v; map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
440 res.add(k);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
441 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
442 return res;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
443 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
444 public Object put(Object key, Object value){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
445 Object res = null;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
446 if( auto vold = key in map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
447 res = *vold;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
448 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
449 map[ key ] = value;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
450 return res;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
451 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
452 public Object put(String key, Object value){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
453 return put( stringcast(key), value );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
454 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
455 public Object put(Object key, String value){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
456 return put( key, stringcast(value) );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
457 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
458 public Object put(String key, String value){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
459 return put( stringcast(key), stringcast(value) );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
460 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
461 public void putAll(Map t){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
462 foreach( k, v; t ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
463 map[k] = v;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
464 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
465 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
466 public Object remove(Object key){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
467 if( auto v = key in map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
468 Object res = *v;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
469 map.remove(key);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
470 return res;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
471 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
472 map.remove(key);
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
473 return null;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
474 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
475 public Object remove(String key){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
476 return remove(stringcast(key));
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
477 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
478 public int size(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
479 return map.size();
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
480 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
481 public Collection values(){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
482 ArrayList res = new ArrayList( size() );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
483 foreach( k, v; map ){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
484 res.add( v );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
485 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
486 return res;
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
487 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
488
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
489 public int opApply (int delegate(ref Object value) dg){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
490 return map.opApply( dg );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
491 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
492 public int opApply (int delegate(ref Object key, ref Object value) dg){
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
493 return map.opApply( dg );
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
494 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
495 }
Frank Benoit <benoit@tionex.de>
parents: 128
diff changeset
496
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
497 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
498 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
499 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
500 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
501 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
502 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
503 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
504 }
04b47443bb01 Reworked the collection 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 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
506 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
507 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
508 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
509 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
510 }
04b47443bb01 Reworked the collection 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 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
512 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
513 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
514 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
515 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
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 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
518 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
519 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
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 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
522 }
04b47443bb01 Reworked the collection 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
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
524
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
525 // no nulls
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
526 // 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
527 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
528
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
529 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
530 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
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 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
533 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
534 }
04b47443bb01 Reworked the collection 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 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
536 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
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 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
539 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
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 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
542 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
543 }
04b47443bb01 Reworked the collection 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
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
545 Object[Object] map;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
546
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
547 // 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
548 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
549 }
04b47443bb01 Reworked the collection 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 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
551 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
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 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
554 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
555 }
04b47443bb01 Reworked the collection 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 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
557 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
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
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
560 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
561 Object[] values;
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
562 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
563 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
564 this.values = values;
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
565 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
566 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
567 return index < values.length;
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
568 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
569 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
570 Object res = values[index];
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
571 index++;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
572 return res;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
573 }
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
574 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
575
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
576 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
577 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
578 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
579 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
580 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
581 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
582 public synchronized void clear(){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
583 map = null;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
584 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
585 public synchronized bool containsKey(Object key){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
586 if( auto v = key in map ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
587 return true;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
588 }
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
589 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
590 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
591 public synchronized bool containsKey(String key){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
592 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
593 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
594 public synchronized bool containsValue(Object value){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
595 foreach( k, v; map ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
596 if( v == value ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
597 return true;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
598 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
599 }
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
600 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
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 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
603 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
604 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
605 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
606 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
607 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
608 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
609 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
610 public synchronized Object get(Object key){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
611 if( auto v = key in map ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
612 return *v;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
613 }
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
614 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
615 }
04b47443bb01 Reworked the collection 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 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
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 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
619 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
620 public synchronized bool isEmpty(){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
621 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
622 }
04b47443bb01 Reworked the collection 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 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
624 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
625 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
626 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
627 public synchronized Object put(Object key, Object value){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
628 Object res = null;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
629 if( auto v = key in map ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
630 res = *v;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
631 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
632 map[ key ] = value;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
633 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
634 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
635 // 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
636 // 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
637 // public Object put(String key, String value)
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
638 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
639 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
640 }
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
641 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
642 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
643 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
644 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
645 // public Object remove(String key)
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
646 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
647 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
648 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
649 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
650 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
651 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
652 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
653
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
654 // 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
655 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
656 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
657 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
658 }
04b47443bb01 Reworked the collection 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 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
660 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
661 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
662 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
664 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
665
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
666 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
667 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
668 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
669 }
04b47443bb01 Reworked the collection 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 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
671 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
672 }
04b47443bb01 Reworked the collection 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 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
674 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
675 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
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 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
678 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
679 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
680 }
04b47443bb01 Reworked the collection 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 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
682 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
683 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
684 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
685 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
686
04b47443bb01 Reworked the collection 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 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
688 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
689 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
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 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
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
04b47443bb01 Reworked the collection 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 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
695 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
696 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
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 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
699 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
700 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
701 }
04b47443bb01 Reworked the collection 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 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
703 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
704 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
705 }
04b47443bb01 Reworked the collection 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 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
707 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
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 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
711 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
712 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
713 }
04b47443bb01 Reworked the collection 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 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
715 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
716 }
04b47443bb01 Reworked the collection 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 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
718 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
719 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
720 }
04b47443bb01 Reworked the collection 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 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
722 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
723 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
724 }
04b47443bb01 Reworked the collection 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 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
726 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
727 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
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 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
730 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
731 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
732 }
04b47443bb01 Reworked the collection 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 }
04b47443bb01 Reworked the collection 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 class TreeMap : Map, SortedMap {
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
736 alias tango.util.container.SortedMap.SortedMap!(Object,Object) MapType;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
737 private MapType map;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
738
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
739 public this(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
740 map = new MapType();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
741 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
742 public this(Comparator c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
743 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
744 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
745 public this(Map m){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
746 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
747 }
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
748 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
749 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
750 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
751 public void clear(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
752 map.clear();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
753 }
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
754 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
755 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
756 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
757 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
758 public bool containsKey(Object key){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
759 Object v;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
760 return map.get(key, v );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
761 }
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
762 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
763 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
764 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
765 public bool containsValue(Object value){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
766 return map.contains(value);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
767 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
768 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
769 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
770 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
771 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
772 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
773 return res;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
774 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
775 public override int opEquals(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
776 if( auto other = cast(HashMap) o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
777 if( other.size() !is size() ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
778 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
779 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
780 foreach( k, v; map ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
781 Object vo = other.get(k);
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
782 if( v != vo ){
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 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
786 return true;
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 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
789 }
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
790 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
791 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
792 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
793 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
794 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
795 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
796 public Object get(Object key){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
797 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
798 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
799 }
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
800 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
801 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
802 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
803 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
804 // 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
805 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
806 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
807 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
808 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
809 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
810 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
811 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
812 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
813 return null;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
814 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
815 public bool isEmpty(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
816 return map.isEmpty();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
817 }
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
818 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
819 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
820 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
821 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
822 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
823 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
824 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
825 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
826 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
827 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
828 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
829 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
830 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
831 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
832 }
04b47443bb01 Reworked the collection 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 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
834 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
835 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
836 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
837 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
838 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
839 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
840 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
841 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
842 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
843 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
844 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
845 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
846 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
847 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
848 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
849 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
850 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
851 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
852 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
853 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
854 }
04b47443bb01 Reworked the collection 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 }
04b47443bb01 Reworked the collection 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 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
857 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
858 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
859 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
860 }
04b47443bb01 Reworked the collection 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 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
862 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
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 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
865 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
866 }
04b47443bb01 Reworked the collection 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 SortedMap subMap(Object fromKey, Object toKey){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
868 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
869 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
870 }
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
871 SortedMap tailMap(Object fromKey){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
872 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
873 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
874 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
875 public Collection values(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
876 ArrayList res = new ArrayList( size() );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
877 foreach( k, v; map ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
878 res.add( v );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
879 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
880 return res;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
881 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
882
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
883 public int opApply (int delegate(ref Object value) dg){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
884 return map.opApply( dg );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
885 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
886 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
887 return map.opApply( dg );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
888 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
889 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
890
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
891 class HashSet : Set {
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
892 alias tango.util.container.HashSet.HashSet!(Object) SetType;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
893 private SetType set;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
894
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
895 public this(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
896 set = new SetType();
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
897 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
898 public this(Collection c){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
899 implMissing( __FILE__, __LINE__ );
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
900 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
901 public this(int initialCapacity){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
902 implMissing( __FILE__, __LINE__ );
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
903 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
904 public this(int initialCapacity, float loadFactor){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
905 implMissing( __FILE__, __LINE__ );
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
906 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
907 public bool add(Object o){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
908 return set.add(o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
909 }
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
910 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
911 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
912 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
913 public bool addAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
914 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
915 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
916 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
917 public void clear(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
918 set.clear();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
919 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
920 public bool contains(Object o){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
921 return set.contains(o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
922 }
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
923 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
924 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
925 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
926 public bool containsAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
927 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
928 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
929 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
930 public override int opEquals(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
931 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
932 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
933 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
934 public override hash_t toHash(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
935 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
936 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
937 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
938 public bool isEmpty(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
939 return set.isEmpty();
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
940 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
941 class LocalIterator : Iterator {
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
942 SetType.Iterator iter;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
943 Object nextElem;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
944 this( SetType.Iterator iter){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
945 this.iter = iter;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
946 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
947 public bool hasNext(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
948 return iter.next(nextElem);
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
949 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
950 public Object next(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
951 return nextElem;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
952 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
953 public void remove(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
954 iter.remove();
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
955 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
956 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
957 public Iterator iterator(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
958 return new LocalIterator(set.iterator());
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
959 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
960 public bool remove(Object o){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
961 return set.remove(o);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
962 }
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
963 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
964 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
965 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
966 public bool removeAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
967 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
968 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
969 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
970 public bool retainAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
971 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
972 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
973 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
974 public int size(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
975 return set.size();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
976 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
977 public Object[] toArray(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
978 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
979 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
980 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
981 public Object[] toArray(Object[] a){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
982 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
983 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
984 }
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
985 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
986 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
987 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
988 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
989
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
990 // 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
991 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
992 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
993 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 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
998 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
999 }
04b47443bb01 Reworked the collection 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 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
1001 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
1002 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
1003 }
04b47443bb01 Reworked the collection 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 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
1005 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
1006 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
1007 }
04b47443bb01 Reworked the collection 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 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
1009 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
1010 }
04b47443bb01 Reworked the collection 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 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
1012 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
1013 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
1014 }
04b47443bb01 Reworked the collection 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 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
1016 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
1017 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
1018 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
1019 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1020 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
1021 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1022 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
1023 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
1024 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
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 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
1027 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
1028 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
1029 }
04b47443bb01 Reworked the collection 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 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
1031 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
1032 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
1033 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
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 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
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 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
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 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
1040 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
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 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
1043 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
1044 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
1045 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
1046 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
1047 }
04b47443bb01 Reworked the collection 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 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
1049 }
04b47443bb01 Reworked the collection 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 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
1051 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
1052 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
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 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
1055 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
1056 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
1057 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
1058 }
04b47443bb01 Reworked the collection 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 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
1060 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
1061 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
1062 }
04b47443bb01 Reworked the collection 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 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
1064 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
1065 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
1066 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 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
1070 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
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 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 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
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 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
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 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
1081 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
1082 }
04b47443bb01 Reworked the collection 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 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
1084 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
1085 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
1086 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
1087 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
1088 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
1089 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
1090
04b47443bb01 Reworked the collection 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 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
1093 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
1094 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
1095 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
1096 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
1097 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
1098 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
1099 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
1100 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
1101 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
1102 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
1103 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 // 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
1106 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
1107 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 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
1110 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
1111 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 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
1114 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
1115 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
1116 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
1117 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
1118 public abstract bool contains(Object o);
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1119 public bool contains(String str){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1120 return contains(stringcast(str));
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1121 }
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
1122 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
1123 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
1124 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
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 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
1127 // 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
1128 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
1129 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
1130 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
1131 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
1132 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
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 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
1135 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 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
1138 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
1139 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
1140 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
1141 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
1142 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
1143 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
1144 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
1145 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
1146 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
1147 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
1148 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
1149 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
1150 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
1151 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
1152 public abstract Object[] toArray(Object[] a);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1153
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1154 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1155
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
1156 class TreeSet : AbstractSet, SortedSet {
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1157
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
1158 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
1159 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
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(){
04b47443bb01 Reworked the collection 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 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
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 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
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 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
1168 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
1169 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1170 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
1171 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
1172 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1173
04b47443bb01 Reworked the collection 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 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
1175 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
1176 }
04b47443bb01 Reworked the collection 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 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
1178 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
1179 }
04b47443bb01 Reworked the collection 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 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
1181 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
1182 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
1183 }
04b47443bb01 Reworked the collection 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 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
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 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
1187 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
1188 }
04b47443bb01 Reworked the collection 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 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
1190 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
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 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
1193 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
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 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
1196 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
1197 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
1198 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
1199 }
04b47443bb01 Reworked the collection 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 }
04b47443bb01 Reworked the collection 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 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
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 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
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 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
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 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
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 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
1210 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1211 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
1212 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
1213 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
1214 }
04b47443bb01 Reworked the collection 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 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
1216 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
1217 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
1218 }
04b47443bb01 Reworked the collection 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 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
1220 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
1221 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
1222 }
04b47443bb01 Reworked the collection 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 public bool isEmpty(){
177
21c77bcb7887 add impl
Frank Benoit <benoit@tionex.de>
parents: 174
diff changeset
1224 return set.isEmpty();
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
1225 }
04b47443bb01 Reworked the collection 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 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
1227 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
1228 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
1229 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1230 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
1231 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
1232 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
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 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
1235 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
1236 }
04b47443bb01 Reworked the collection 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 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
1238 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
1239 }
04b47443bb01 Reworked the collection 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 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
1241 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
1242 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
1243 }
04b47443bb01 Reworked the collection 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 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
1245 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
1246 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
1247 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1248 public int size(){
177
21c77bcb7887 add impl
Frank Benoit <benoit@tionex.de>
parents: 174
diff changeset
1249 return set.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
1250 }
04b47443bb01 Reworked the collection 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 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
1252 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
1253 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
1254 }
04b47443bb01 Reworked the collection 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 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
1256 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
1257 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
1258 }
04b47443bb01 Reworked the collection 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 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
1260 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
1261 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
1262 }
04b47443bb01 Reworked the collection 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 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
1264 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
1265 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
1266 }
04b47443bb01 Reworked the collection 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 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
1268 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
1269 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
1270 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 // 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
1274 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
1275 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
1276 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
1277 }
04b47443bb01 Reworked the collection 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 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
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 }
04b47443bb01 Reworked the collection 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
04b47443bb01 Reworked the collection 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 class Vector : AbstractList, List {
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1283 Object[] vect;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1284 int used;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1285 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
1286 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
1287 }
04b47443bb01 Reworked the collection 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 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
1289 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
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 this(int initialCapacity){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1292 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
1293 }
04b47443bb01 Reworked the collection 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 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
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 }
04b47443bb01 Reworked the collection 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 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
1298 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
1299 }
04b47443bb01 Reworked the collection 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 public bool add(Object o){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1301 if( used + 1 >= vect.length ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1302 vect.length = vect.length + capacityIncrement;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1303 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1304 vect[used] = o;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1305 used++;
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1306 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
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 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
1309 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
1310 }
04b47443bb01 Reworked the collection 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 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
1312 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
1313 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
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 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
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 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
1318 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1319 public void addElement(Object obj){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1320 add(obj);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1321 }
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
1322 public int capacity(){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1323 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
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 void clear(){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1326 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
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 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
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 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
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 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
1335 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1336 public bool contains(String str){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1337 return contains(stringcast(str));
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1338 }
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
1339 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
1340 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
1341 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
1342 }
04b47443bb01 Reworked the collection 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 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
1344 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
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 public Object elementAt(int index){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1347 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
1348 }
04b47443bb01 Reworked the collection 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 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
1350 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
1351 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
1352 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1353 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
1354 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
1355 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1356 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
1357 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
1358 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
1359 }
04b47443bb01 Reworked the collection 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 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
1361 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
1362 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
1363 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1364 public Object get(int index){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1365 if( index >= used || index < 0 ){
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1366 throw new tango.core.Exception.ArrayBoundsException( __FILE__, __LINE__ );
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1367 }
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1368 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
1369 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1370 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
1371 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
1372 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
1373 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1374 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
1375 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
1376 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
1377 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1378 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
1379 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
1380 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
1381 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1382 public void insertElementAt(Object obj, int index){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1383 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1384 }
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
1385 public bool isEmpty(){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1386 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
1387 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1388 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
1389 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
1390 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
1391 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1392 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
1393 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
1394 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
1395 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1396 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
1397 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
1398 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
1399 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1400 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
1401 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
1402 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
1403 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1404 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
1405 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
1406 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
1407 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1408 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
1409 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
1410 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
1411 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1412 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
1413 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
1414 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
1415 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1416 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
1417 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
1418 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
1419 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1420 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
1421 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
1422 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1423 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
1424 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
1425 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
1426 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1427 public void removeAllElements(){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1428 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1429 }
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
1430 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
1431 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
1432 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
1433 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1434 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
1435 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
1436 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1437 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
1438 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
1439 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1440 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
1441 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
1442 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
1443 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1444 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
1445 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
1446 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
1447 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1448 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
1449 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
1450 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1451 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
1452 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
1453 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1454 public int size(){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1455 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
1456 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1457 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
1458 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
1459 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
1460 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1461 public Object[] toArray(){
127
1997315125c0 more collection impls
Frank Benoit <benoit@tionex.de>
parents: 121
diff changeset
1462 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
1463 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1464 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
1465 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
1466 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
1467 }
04b47443bb01 Reworked the collection 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 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
1469 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
1470 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
1471 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1472 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
1473 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
1474 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1475
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1476 // 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
1477 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
1478 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
1479 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
1480 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1481
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1482 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1483
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1484 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
1485 this(){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1486 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1487 void add(int index, Object element){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1488 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1489 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1490 bool add(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1491 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1492 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1493 }
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
1494 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
1495 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
1496 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1497 bool addAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1498 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1499 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1500 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1501 bool addAll(int index, Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1502 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1503 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1504 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1505 void addElement(Object obj){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1506 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1507 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1508 int capacity(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1509 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1510 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1511 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1512 void clear(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1513 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1514 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1515 Object clone(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1516 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1517 return null;
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 bool contains(Object elem){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1520 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1521 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1522 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1523 bool containsAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1524 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1525 return false;
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 void copyInto(Object[] anArray){
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 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1530 Object elementAt(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1531 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1532 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1533 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1534 // Enumeration elements(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1535 // implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1536 // return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1537 // }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1538 void ensureCapacity(int minCapacity){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1539 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1540 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1541 int opEquals(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1542 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1543 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1544 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1545 Object firstElement(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1546 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1547 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1548 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1549 Object get(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1550 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1551 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1552 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1553 hash_t toHash(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1554 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1555 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1556 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1557 int indexOf(Object elem){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1558 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1559 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1560 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1561 int indexOf(Object elem, int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1562 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1563 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1564 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1565 void insertElementAt(Object obj, int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1566 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1567 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1568 bool isEmpty(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1569 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1570 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1571 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1572 Iterator iterator(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1573 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1574 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1575 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1576 Object lastElement(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1577 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1578 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1579 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1580 int lastIndexOf(Object elem){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1581 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1582 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1583 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1584 int lastIndexOf(Object elem, int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1585 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1586 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1587 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1588 ListIterator listIterator(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1589 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1590 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1591 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1592 ListIterator listIterator(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1593 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1594 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1595 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1596 Object remove(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1597 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1598 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1599 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1600 bool remove(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1601 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1602 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1603 }
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 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
1605 return remove(stringcast(key));
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1606 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1607 bool removeAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1608 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1609 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1610 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1611 void removeAllElements(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1612 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1613 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1614 bool removeElement(Object obj){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1615 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1616 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1617 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1618 void removeElementAt(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1619 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1620 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1621 protected void removeRange(int fromIndex, int toIndex){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1622 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1623 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1624 bool retainAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1625 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1626 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1627 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1628 Object set(int index, Object element){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1629 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1630 return null;
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 void setElementAt(Object obj, int index){
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 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1635 void setSize(int newSize){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1636 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1637 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1638 int size(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1639 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1640 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1641 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1642 List subList(int fromIndex, int toIndex){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1643 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1644 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1645 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1646 Object[] toArray(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1647 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1648 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1649 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1650 Object[] toArray(Object[] a){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1651 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1652 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1653 }
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 // from Stack
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1656 String toString(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1657 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1658 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1659 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1660 void trimToSize(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1661 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1662 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1663 bool empty(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1664 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1665 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1666 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1667 Object peek(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1668 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1669 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1670 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1671 Object pop(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1672 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1673 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1674 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1675 Object push(Object item){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1676 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1677 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1678 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1679 int search(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1680 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1681 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1682 }
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
1683
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1684 // 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
1685 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
1686 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
1687 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
1688 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1689
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1690 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1691
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1692 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
1693 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
1694 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
1695
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1696 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
1697 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
1698 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1699 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
1700 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
1701 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
1702 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1703 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
1704 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
1705 return true;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1706 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1707 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
1708 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
1709 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
1710 }
04b47443bb01 Reworked the collection 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 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
1712 return add(stringcast(o));
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1713 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1714 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
1715 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
1716 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
1717 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
1718 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
1719 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1720 return res;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1721 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1722 bool addAll(int index, Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1723 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1724 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1725 }
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
1726 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
1727 list.prepend( o );
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1728 }
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
1729 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
1730 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
1731 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1732 // 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
1733 // 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
1734 // }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1735 int capacity(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1736 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1737 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1738 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1739 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
1740 list.clear();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1741 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1742 Object clone(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1743 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1744 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1745 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1746 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
1747 return list.contains(elem);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1748 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1749 bool contains(String elem){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1750 return contains(stringcast(elem));
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1751 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1752 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
1753 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
1754 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
1755 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1756 return true;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1757 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1758 void copyInto(Object[] anArray){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1759 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1760 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1761 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
1762 return list.get(index);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1763 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1764 // Enumeration elements(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1765 // implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1766 // return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1767 // }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1768 void ensureCapacity(int minCapacity){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1769 implMissing( __FILE__, __LINE__ );
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 int opEquals(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1772 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1773 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1774 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1775 Object firstElement(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1776 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1777 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1778 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1779 Object get(int index){
116
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1780 return list.get(index);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1781 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1782 Object getFirst(){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1783 return list.get(0);
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1784 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1785 Object getLast(){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1786 return list.get(list.size()-1);
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1787 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1788 hash_t toHash(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1789 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1790 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1791 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1792 int indexOf(Object elem){
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 0;
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 int indexOf(Object elem, int index){
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 0;
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 insertElementAt(Object obj, int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1801 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1802 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1803 bool isEmpty(){
116
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1804 return list.isEmpty();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1805 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1806 Iterator iterator(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1807 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1808 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1809 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1810 Object lastElement(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1811 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1812 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1813 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1814 int lastIndexOf(Object elem){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1815 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1816 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1817 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1818 int lastIndexOf(Object elem, int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1819 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1820 return 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1821 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1822 ListIterator listIterator(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1823 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1824 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1825 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1826 ListIterator listIterator(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1827 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1828 return null;
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 Object remove(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1831 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1832 return null;
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 bool remove(Object o){
116
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1835 return list.remove(o,false) !is 0;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1836 }
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
1837 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
1838 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
1839 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1840 bool removeAll(Collection c){
116
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1841 bool res = false;
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1842 foreach( o; c){
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1843 res |= list.remove(o,false) !is 0;
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1844 }
1c497c6c0ad8 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 114
diff changeset
1845 return res;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1846 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1847 void removeAllElements(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1848 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1849 }
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
1850 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
1851 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
1852 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
1853 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1854 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
1855 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
1856 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
1857 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1858 bool removeElement(Object obj){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1859 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1860 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1861 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1862 void removeElementAt(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1863 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1864 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1865 protected void removeRange(int fromIndex, int toIndex){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1866 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1867 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1868 bool retainAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1869 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1870 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1871 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1872 Object set(int index, Object element){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1873 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1874 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1875 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1876 void setElementAt(Object obj, int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1877 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1878 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1879 void setSize(int newSize){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1880 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1881 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1882 int size(){
114
efda8ce1120b Add LinkedList.size()
Frank Benoit <benoit@tionex.de>
parents: 106
diff changeset
1883 return list.size();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1884 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1885 List subList(int fromIndex, int toIndex){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1886 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1887 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1888 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1889 Object[] toArray(){
121
c0304616ea23 Fix: tango assertion error, see tango ticket 1237
Frank Benoit <benoit@tionex.de>
parents: 119
diff changeset
1890 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
1891 return list.toArray();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1892 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1893 Object[] toArray(Object[] a){
121
c0304616ea23 Fix: tango assertion error, see tango ticket 1237
Frank Benoit <benoit@tionex.de>
parents: 119
diff changeset
1894 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
1895 return list.toArray( a );
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1896 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1897 String toString(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1898 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1899 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1900 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1901 void trimToSize(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1902 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1903 }
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
1904
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1905 // 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
1906 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
1907 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
1908 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
1909 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
1910
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1911 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1912
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
1913 class ArrayList : AbstractList, List {
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1914 private Object[] data;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1915
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1916 this(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1917 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1918 this(int size){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1919 data.length = size;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1920 data.length = 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1921 }
174
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1922 this(Collection col){
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1923 this(cast(int)(col.size*1.1));
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1924 addAll(col);
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1925 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1926 void add(int index, Object element){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1927 data.length = data.length +1;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1928 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
1929 data[index] = element;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1930 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1931 bool add(Object o){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1932 data ~= o;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1933 return true;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1934 }
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
1935 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
1936 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
1937 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1938 bool addAll(Collection c){
174
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1939 if( c.size() is 0 ) return false;
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1940 uint idx = data.length;
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1941 data.length = data.length + c.size();
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1942 foreach( o; c ){
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1943 data[ idx++ ] = o;
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1944 }
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
1945 return true;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1946 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1947 bool addAll(int index, Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1948 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1949 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1950 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1951 void clear(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1952 data.length = 0;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1953 }
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
1954 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
1955 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
1956 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
1957 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1958 bool contains(Object o){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1959 foreach( v; data ){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1960 if( o is v ){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1961 return true;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1962 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1963 if(( o is null ) || ( v is null )){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1964 continue;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1965 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1966 if( o == v ){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1967 return true;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1968 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
1969 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1970 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1971 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1972 bool contains(String o){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1973 return contains(stringcast(o));
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
1974 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1975 bool containsAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1976 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1977 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1978 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1979 int opEquals(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1980 if( auto other = cast(ArrayList)o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1981 if( data.length !is other.data.length ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1982 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1983 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1984 for( int i = 0; i < data.length; i++ ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1985 if( data[i] is other.data[i] ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1986 continue;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1987 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1988 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
1989 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1990 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1991 if( data[i] == other.data[i] ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1992 continue;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1993 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1994 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1995 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1996 return true;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1997 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1998 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1999 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2000 Object get(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2001 return data[index];
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2002 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2003 public override hash_t toHash(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2004 return super.toHash();
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2005 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2006 int indexOf(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2007 foreach( i, v; data ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2008 if( data[i] is o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2009 return i;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2010 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2011 if(( data[i] is null ) || ( o is null )){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2012 continue;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2013 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2014 if( data[i] == o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2015 return i;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2016 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2017 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2018 return -1;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2019 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2020 bool isEmpty(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2021 return data.length is 0;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2022 }
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2023 class LocalIterator : Iterator{
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2024 int idx = 0;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2025 public this(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2026 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2027 public bool hasNext(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2028 return idx < data.length;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2029 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2030 public Object next(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2031 Object res = data[idx];
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2032 idx++;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2033 return res;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2034 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2035 public void remove(){
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2036 implMissing( __FILE__, __LINE__ );
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2037 this.outer.remove(idx);
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2038 idx--;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2039 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2040 }
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2041
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2042 Iterator iterator(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2043 return new LocalIterator();
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2044 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2045 int lastIndexOf(Object o){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2046 foreach_reverse( i, v; data ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2047 if( data[i] is o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2048 return i;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2049 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2050 if(( data[i] is null ) || ( o is null )){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2051 continue;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2052 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2053 if( data[i] == o ){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2054 return i;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2055 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2056 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2057 return -1;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2058 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2059 ListIterator listIterator(){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2060 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2061 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2062 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2063 ListIterator listIterator(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2064 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2065 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2066 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2067 Object remove(int index){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2068 Object res = data[index];
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2069 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
2070 data.length = data.length -1;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2071 return res;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2072 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2073 bool remove(Object o){
119
35f1d208f3c3 Collection impl
Frank Benoit <benoit@tionex.de>
parents: 116
diff changeset
2074 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
2075 }
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
2076 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
2077 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
2078 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2079 bool removeAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2080 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2081 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2082 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2083 bool retainAll(Collection c){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2084 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2085 return false;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2086 }
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
2087 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
2088 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
2089 }
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2090 Object set(int index, Object element){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2091 Object res = data[index];
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2092 data[index] = element;
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2093 return res;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2094 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2095 int size(){
101
1082a0fc2bb8 First Draw2D example running
Frank Benoit <benoit@tionex.de>
parents: 100
diff changeset
2096 return data.length;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2097 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2098 List subList(int fromIndex, int toIndex){
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2099 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2100 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2101 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2102 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
2103 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
2104 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2105 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
2106 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
2107 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
2108 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2109 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
2110 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
2111 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2112 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
2113 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
2114 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2115 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
2116 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2117
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2118 // 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
2119 public int opApply (int delegate(ref Object value) dg){
174
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
2120 foreach( o; data ){
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
2121 auto res = dg( o );
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
2122 if( res ) return res;
c6d7b1ea700b First sample running
Frank Benoit <benoit@tionex.de>
parents: 172
diff changeset
2123 }
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
2124 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
2125 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2126 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2127
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2128 class Arrays {
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2129 public static bool equals(T)(T[] a, T[] b){
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
2130 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
2131 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
2132 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2133 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
2134 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
2135 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
2136 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2137 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
2138 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
2139 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2140 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
2141 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2142 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
2143 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2144 /+ public static bool equals(Object[] a, Object[] b){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2145 if( a.length !is b.length ){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2146 return false;
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2147 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2148 for( int i = 0; i < a.length; i++ ){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2149 if( a[i] is null && b[i] is null ){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2150 continue;
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2151 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2152 if( a[i] !is null && b[i] !is null && a[i] == b[i] ){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2153 continue;
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2154 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2155 return false;
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2156 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2157 return true;
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2158 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2159 +/
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2160 static void sort( T )( T[] a, Comparator c ){
172
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2161 static if( is( T : char[] )){
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2162 bool isLess( String o1, String o2 ){
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2163 return c.compare( stringcast(o1), stringcast(o2) ) < 0;
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2164 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2165 }
172
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2166 else{
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2167 bool isLess( T o1, T o2 ){
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2168 return c.compare( cast(Object)o1, cast(Object)o2 ) < 0;
d994a8b2cdf7 again compile fixes
Frank Benoit <benoit@tionex.de>
parents: 171
diff changeset
2169 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2170 }
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2171 tango.core.Array.sort( a, &isLess );
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2172 }
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
2173 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
2174 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
2175 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
2176 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
2177 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
2178 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2179 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
2180 }
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2181 public static void fill( String str, char c ){
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2182 str[] = c;
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2183 }
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
2184 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2185
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2186 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
2187
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2188 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
2189 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
2190 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
2191 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
2192 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
2193 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
2194 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2195 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2196 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2197 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
2198 }
106
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2199 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
2200 public static Map EMPTY_MAP(){
106
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2201 if( EMPTY_MAP_ is null ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2202 synchronized(Collections.classinfo ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2203 if( EMPTY_MAP_ is null ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2204 EMPTY_MAP_ = new TreeMap();
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2205 }
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2206 }
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2207 }
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2208 return EMPTY_MAP_;
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2209 }
106
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2210 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
2211 public static Set EMPTY_SET(){
106
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2212 if( EMPTY_SET_ is null ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2213 synchronized(Collections.classinfo ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2214 if( EMPTY_SET_ is null ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2215 EMPTY_SET_ = new TreeSet();
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2216 }
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2217 }
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2218 }
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2219 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
2220 }
161
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2221 static int binarySearch(List list, Object key){
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2222 implMissing( __FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2223 return 0;
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2224 }
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2225 static int binarySearch(List list, Object key, Comparator c){
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2226 implMissing( __FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2227 return 0;
Frank Benoit <benoit@tionex.de>
parents: 159
diff changeset
2228 }
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
2229 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
2230 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
2231 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
2232 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2233 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
2234 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
2235 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
2236 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2237 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
2238 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
2239 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
2240 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2241 public static Set singleton( Object o ){
106
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2242 TreeSet res = new TreeSet();
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2243 res.add(o);
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2244 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
2245 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2246 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
2247 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
2248 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2249 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
2250 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
2251 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2252
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2253 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
2254 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
2255 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
2256 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2257 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
2258 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
2259 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
2260 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2261 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
2262 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
2263 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
2264 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2265 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
2266 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
2267 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
2268 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2269 // 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
2270 // 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
2271 // 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
2272 // }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2273 // 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
2274 // 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
2275 // 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
2276 // }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2277 static void reverse(List list) {
106
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2278 Object[] data = list.toArray();
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2279 for( int idx = 0; idx < data.length; idx++ ){
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2280 list.set( data.length -1 -idx, data[idx] );
8ab6fb387666 more Collection impl
Frank Benoit <benoit@tionex.de>
parents: 104
diff changeset
2281 }
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
2282 }
04b47443bb01 Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents: 101
diff changeset
2283 static Enumeration enumeration(Collection c){
100
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2284 implMissing( __FILE__, __LINE__ );
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2285 return null;
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2286 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2287 }
86617aa6b5dd More helper classes, needed by draw2d
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2288
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2289 class LinkedHashMap : HashMap {
171
ee33f30b14e2 fix always triggered exit
Frank Benoit <benoit@tionex.de>
parents: 162
diff changeset
2290 this(){
162
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2291 implMissing( __FILE__, __LINE__ );
Frank Benoit <benoit@tionex.de>
parents: 161
diff changeset
2292 }
177
21c77bcb7887 add impl
Frank Benoit <benoit@tionex.de>
parents: 174
diff changeset
2293 }