package org.psjava.ds.array;

import java.util.Iterator;

import org.psjava.javautil.IterableToString;



public class MutableArrayUsingIntArray {
	
	public static MutableArray<Integer> wrap(final int[] a) {
		return new MutableArray<Integer>() {
			public Integer get(int i) {
				return a[i];
			}

			public void set(int i, Integer v) {
				a[i] = v;
			}

			public int size() {
				return a.length;
			}

			@Override
			public final boolean isEmpty() {
				return size() == 0;
			}

			@Override
			public final Iterator<Integer> iterator() {
				return ArrayIterator.create(this);
			}

			@Override
			public final String toString() {
				return IterableToString.toString(this);
			}
		};
	}

}

@@ -97,18 +97,16 @@
 tring;%0A%0A
-%0A%0A
 public c
@@ -142,10 +142,9 @@
 y %7B%0A
-%09
 %0A
+
 %09pub
@@ -237,16 +237,29 @@
 er%3E() %7B%0A
+%09%09%09@Override%0A
 %09%09%09publi
@@ -296,32 +296,45 @@
 urn a%5Bi%5D;%0A%09%09%09%7D%0A%0A
+%09%09%09@Override%0A
 %09%09%09public void s
@@ -376,16 +376,29 @@
 ;%0A%09%09%09%7D%0A%0A
+%09%09%09@Override%0A
 %09%09%09publi

improve code style