1 module java.util.Vector; 2 3 import java.lang.all; 4 import java.util.AbstractList; 5 import java.util.List; 6 import java.util.Collection; 7 import java.util.Enumeration; 8 import java.util.Iterator; 9 import java.util.ListIterator; 10 11 class Vector : AbstractList, List { 12 Object[] vect; 13 int used; 14 int capacityIncrement = 32; 15 public this(){ 16 } 17 public this(Collection c){ 18 implMissing( __FILE__, __LINE__ ); 19 } 20 public this(int initialCapacity){ 21 vect.length = initialCapacity; 22 } 23 public this(int initialCapacity, int capacityIncrement){ 24 implMissing( __FILE__, __LINE__ ); 25 } 26 override 27 public void add(int index, Object element){ 28 implMissing( __FILE__, __LINE__ ); 29 } 30 override 31 public bool add(Object o){ 32 if( used + 1 >= vect.length ){ 33 vect.length = vect.length + capacityIncrement; 34 } 35 vect[used] = o; 36 used++; 37 return true; 38 } 39 override 40 public bool add(String o){ 41 return add(stringcast(o)); 42 } 43 override 44 public bool addAll(Collection c){ 45 implMissing( __FILE__, __LINE__ ); 46 return false; 47 } 48 override 49 public bool addAll(int index, Collection c){ 50 implMissing( __FILE__, __LINE__ ); 51 return false; 52 } 53 public void addElement(Object obj){ 54 add(obj); 55 } 56 public int capacity(){ 57 return cast(int)/*64bit*/vect.length; 58 } 59 override 60 public void clear(){ 61 used = 0; 62 } 63 public Object clone(){ 64 implMissing( __FILE__, __LINE__ ); 65 return null; 66 } 67 override 68 public bool contains(Object elem){ 69 implMissing( __FILE__, __LINE__ ); 70 return false; 71 } 72 override 73 public bool contains(String str){ 74 return contains(stringcast(str)); 75 } 76 override 77 public bool containsAll(Collection c){ 78 implMissing( __FILE__, __LINE__ ); 79 return false; 80 } 81 public void copyInto(void*[] anArray){ 82 implMissing( __FILE__, __LINE__ ); 83 } 84 //public void copyInto(Object[] anArray){ 85 // implMissing( __FILE__, __LINE__ ); 86 //} 87 public Object elementAt(int index){ 88 return get(index); 89 } 90 public Enumeration elements(){ 91 implMissing( __FILE__, __LINE__ ); 92 return null; 93 } 94 public void ensureCapacity(int minCapacity){ 95 implMissing( __FILE__, __LINE__ ); 96 } 97 override 98 public equals_t opEquals(Object o){ 99 implMissing( __FILE__, __LINE__ ); 100 return false; 101 } 102 public Object firstElement(){ 103 implMissing( __FILE__, __LINE__ ); 104 return null; 105 } 106 override 107 public Object get(int index){ 108 if( index >= used || index < 0 ){ 109 throw new ArrayIndexOutOfBoundsException( __FILE__, __LINE__ ); 110 } 111 return vect[index]; 112 } 113 override 114 public hash_t toHash(){ 115 implMissingSafe( __FILE__, __LINE__ ); 116 return 0; 117 } 118 override 119 public int indexOf(Object elem){ 120 implMissing( __FILE__, __LINE__ ); 121 return 0; 122 } 123 public int indexOf(Object elem, int index){ 124 implMissing( __FILE__, __LINE__ ); 125 return 0; 126 } 127 public void insertElementAt(Object obj, int index){ 128 implMissing( __FILE__, __LINE__ ); 129 } 130 override 131 public bool isEmpty(){ 132 return used is 0; 133 } 134 override 135 public Iterator iterator(){ 136 implMissing( __FILE__, __LINE__ ); 137 return null; 138 } 139 public Object lastElement(){ 140 implMissing( __FILE__, __LINE__ ); 141 return null; 142 } 143 override 144 public int lastIndexOf(Object elem){ 145 implMissing( __FILE__, __LINE__ ); 146 return 0; 147 } 148 public int lastIndexOf(Object elem, int index){ 149 implMissing( __FILE__, __LINE__ ); 150 return 0; 151 } 152 override 153 public ListIterator listIterator(){ 154 implMissing( __FILE__, __LINE__ ); 155 return null; 156 } 157 override 158 public ListIterator listIterator(int index){ 159 implMissing( __FILE__, __LINE__ ); 160 return null; 161 } 162 override 163 public Object remove(int index){ 164 implMissing( __FILE__, __LINE__ ); 165 return null; 166 } 167 override 168 public bool remove(Object o){ 169 implMissing( __FILE__, __LINE__ ); 170 return false; 171 } 172 override 173 public bool remove(String key){ 174 return remove(stringcast(key)); 175 } 176 override 177 public bool removeAll(Collection c){ 178 implMissing( __FILE__, __LINE__ ); 179 return false; 180 } 181 public void removeAllElements(){ 182 implMissing( __FILE__, __LINE__ ); 183 } 184 public bool removeElement(Object obj){ 185 implMissing( __FILE__, __LINE__ ); 186 return false; 187 } 188 public void removeElementAt(int index){ 189 implMissing( __FILE__, __LINE__ ); 190 } 191 override 192 protected void removeRange(int fromIndex, int toIndex){ 193 implMissing( __FILE__, __LINE__ ); 194 } 195 override 196 public bool retainAll(Collection c){ 197 implMissing( __FILE__, __LINE__ ); 198 return false; 199 } 200 override 201 public Object set(int index, Object element){ 202 implMissing( __FILE__, __LINE__ ); 203 return null; 204 } 205 public void setElementAt(Object obj, int index){ 206 implMissing( __FILE__, __LINE__ ); 207 } 208 public void setSize(int newSize){ 209 implMissing( __FILE__, __LINE__ ); 210 } 211 override 212 public int size(){ 213 return used; 214 } 215 override 216 public List subList(int fromIndex, int toIndex){ 217 implMissing( __FILE__, __LINE__ ); 218 return null; 219 } 220 override 221 public Object[] toArray(){ 222 return vect[ 0 .. used ].dup; 223 } 224 override 225 public Object[] toArray(Object[] a){ 226 implMissing( __FILE__, __LINE__ ); 227 return null; 228 } 229 override 230 String[] toArray(String[] a){ 231 implMissing( __FILE__, __LINE__ ); 232 return null; 233 } 234 override 235 public String toString(){ 236 implMissing( __FILE__, __LINE__ ); 237 return null; 238 } 239 public void trimToSize(){ 240 implMissing( __FILE__, __LINE__ ); 241 } 242 243 // only for D 244 override 245 public int opApply (int delegate(ref Object value) dg){ 246 implMissing( __FILE__, __LINE__ ); 247 return 0; 248 } 249 250 } 251