@SuppressWarnings("unchecked") @Override public U get(int index) { int size = array.count(); if (index < 0 || index >= size) { throw new IndexOutOfBoundsException("index = " + index + ", size = " + size); } return (U) array.objectAtIndex(index); }
@Override public boolean contains(Object o) { if (o instanceof NSObject) { return array.containsObject((NSObject) o); } return false; }
@Override public int size() { return array.count(); }
@Callback @BindSelector("objectAtIndex:") public static NSObject objectAtIndex(NSArray __self__, Selector __cmd__, int index) { return __self__.objectAtIndex(index); }
@Callback @BindSelector("subarrayWithRange:") public static NSArray subarrayWithRange( NSArray __self__, Selector __cmd__, @ByVal NSRange range) { return __self__.subarrayWithRange(range); }
@Callback @BindSelector("initWithObjects:count:") public static @Pointer long initWithObjects( NSArray __self__, Selector __cmd__, @Pointer long objects, int count) { return __self__.initWithObjects(objects, count); }
@Callback @BindSelector("initWithArray:") public static @Pointer long initWithArray(NSArray __self__, Selector __cmd__, NSArray anArray) { return __self__.initWithArray(anArray); }
@Callback @BindSelector("indexOfObject:") public static int indexOfObject(NSArray __self__, Selector __cmd__, NSObject anObject) { return __self__.indexOfObject(anObject); }
@Callback @BindSelector("count") public static int count(NSArray __self__, Selector __cmd__) { return __self__.count(); }
@Callback @BindSelector("containsObject:") public static boolean containsObject(NSArray __self__, Selector __cmd__, NSObject anObject) { return __self__.containsObject(anObject); }