package speiger.src.collections.PACKAGE.utils; import speiger.src.collections.PACKAGE.collections.ITERATOR; public class ITERATORS { public static GENERIC_BRACES ArrayIterator KEY_GENERIC_TYPE wrap(KEY_TYPE[] a) { return wrap(a, 0, a.length); } public static GENERIC_BRACES ArrayIterator KEY_GENERIC_TYPE wrap(KEY_TYPE[] a, int start, int end) { return new ArrayIteratorBRACES(a, start, end); } public static GENERIC_BRACES int unwrap(KEY_TYPE[] a, ITERATOR KEY_GENERIC_TYPE i) { return unwrap(a, i, 0, a.length); } public static GENERIC_BRACES int unwrap(KEY_TYPE[] a, ITERATOR KEY_GENERIC_TYPE i, int offset) { return unwrap(a, i, offset, a.length); } public static GENERIC_BRACES int unwrap(KEY_TYPE[] a, ITERATOR KEY_GENERIC_TYPE i, int offset, int max) { if(max < 0) throw new IllegalStateException("The max size is smaller then 0"); if(offset + max >= a.length) throw new IllegalStateException("largest array index exceeds array size"); int index = 0; for(;index= a.length) throw new IllegalStateException("largest array index exceeds array size"); int index = 0; for(;index