annotate dwtx/dwtxhelper/Collection.d @ 116:1c497c6c0ad8

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