Code example for Vector

0
 
    public class AMT extends AbstractMap {
 
        // Very crude AbstractMap implementation 
        Vector values = new Vector();
        Vector keys   = new Vector();
 
        public Set entrySet() {
            return new AbstractSet() {
                public Iterator iterator() {
                    return new Iterator() {
                        int index = 0;
 
                        public boolean hasNext() { 
                            return index < values.size();
                        } 
 
                        public Object next() {
                            if (index < values.size()) {
                                Map.Entry me = new Map.Entry() {
                                    Object v = values.elementAt(index);