Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.antlr.stringtemplate.language;
 
Turn an array into a List; subclass ArrayList for easy development, but it really doesn't use super stuff for anything. Ensure we create ArrayIterator for this List.
public class ArrayWrappedInList extends ArrayList {
	protected Object array = null;
Arrays are fixed size; precompute.
	protected int n;
	public ArrayWrappedInList(Object array) {
		this. = array;
		 = Array.getLength(array);
	}
	public Object get(int i) {
		return Array.get(i);
	}
	public int size() {
		return ;
	}
	public boolean isEmpty() {
		return ==0;
	}
	public Object[] toArray() {
		return (Object[]);
	}
	public Iterator iterator() {
		return new ArrayIterator();
	}
New to GrepCode? Check out our FAQ X