Beispiel #1
0
 @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);
 }
 @MarshalsPointer
 public static long toNative(List<CNInstantMessageAddressPropertyKey> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (CNInstantMessageAddressPropertyKey o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<HKDietaryQuantityTypeIdentifier> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (HKDietaryQuantityTypeIdentifier o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<NSCocoaErrorUserInfoKey> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (NSCocoaErrorUserInfoKey i : l) {
     array.add(i.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<NSURLProtectionSpaceProxyType> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (NSURLProtectionSpaceProxyType o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<NSStreamSOCKSProxyVersion> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (NSStreamSOCKSProxyVersion o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<AVAudioSessionOrientation> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (AVAudioSessionOrientation o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<CIContextOptions> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSDictionary> array = new NSMutableArray<>();
   for (CIContextOptions i : l) {
     array.add(i.getDictionary());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
Beispiel #9
0
 @MarshalsPointer
 public static long toNative(List<SCNLightingModel> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (SCNLightingModel o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<AVSampleRateConverterSettings> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSDictionary> array = new NSMutableArray<>();
   for (AVSampleRateConverterSettings i : l) {
     array.add(i.getDictionary());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<AVLayerVideoGravity> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (AVLayerVideoGravity o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<AVOutputSettingsPreset> l, long flags) {
   if (l == null) {
     return 0L;
   }
   NSArray<NSString> array = new NSMutableArray<>();
   for (AVOutputSettingsPreset o : l) {
     array.add(o.value());
   }
   return NSObject.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static List<CBCentralManagerOptions> toObject(
     Class<? extends NSObject> cls, long handle, long flags) {
   NSArray<NSDictionary> o =
       (NSArray<NSDictionary>) NSObject.Marshaler.toObject(NSArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<CBCentralManagerOptions> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(new CBCentralManagerOptions(o.get(i)));
   }
   return list;
 }
Beispiel #14
0
 @SuppressWarnings("unchecked")
 @MarshalsPointer
 public static List<SCNLightingModel> toObject(
     Class<? extends NSObject> cls, long handle, long flags) {
   NSArray<NSString> o = (NSArray<NSString>) NSObject.Marshaler.toObject(cls, handle, flags);
   if (o == null) {
     return null;
   }
   List<SCNLightingModel> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(SCNLightingModel.valueOf(o.get(i)));
   }
   return list;
 }
 @MarshalsPointer
 public static List<AVSampleRateConverterSettings> toObject(
     Class<? extends NSObject> cls, long handle, long flags) {
   NSArray<NSDictionary> o =
       (NSArray<NSDictionary>) NSObject.Marshaler.toObject(NSArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<AVSampleRateConverterSettings> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(new AVSampleRateConverterSettings(o.get(i)));
   }
   return list;
 }
 @SuppressWarnings("unchecked")
 @MarshalsPointer
 public static List<HKDietaryQuantityTypeIdentifier> toObject(
     Class<? extends NSObject> cls, long handle, long flags) {
   NSArray<NSString> o =
       (NSArray<NSString>) NSObject.Marshaler.toObject(NSArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<HKDietaryQuantityTypeIdentifier> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(HKDietaryQuantityTypeIdentifier.valueOf(o.get(i)));
   }
   return list;
 }
 @SuppressWarnings("unchecked")
 @MarshalsPointer
 public static List<CNInstantMessageAddressPropertyKey> toObject(
     Class<? extends NSObject> cls, long handle, long flags) {
   NSArray<NSString> o =
       (NSArray<NSString>) NSObject.Marshaler.toObject(NSArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<CNInstantMessageAddressPropertyKey> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(CNInstantMessageAddressPropertyKey.valueOf(o.get(i)));
   }
   return list;
 }
Beispiel #18
0
 @Override
 public boolean contains(Object o) {
   if (o instanceof NSObject) {
     return array.containsObject((NSObject) o);
   }
   return false;
 }
Beispiel #19
0
 @Callback
 @BindSelector("count")
 public static int count(NSArray __self__, Selector __cmd__) {
   return __self__.count();
 }
Beispiel #20
0
 @Callback
 @BindSelector("initWithArray:")
 public static @Pointer long initWithArray(NSArray __self__, Selector __cmd__, NSArray anArray) {
   return __self__.initWithArray(anArray);
 }
Beispiel #21
0
 @Callback
 @BindSelector("initWithObjects:count:")
 public static @Pointer long initWithObjects(
     NSArray __self__, Selector __cmd__, @Pointer long objects, int count) {
   return __self__.initWithObjects(objects, count);
 }
Beispiel #22
0
 @Callback
 @BindSelector("objectAtIndex:")
 public static NSObject objectAtIndex(NSArray __self__, Selector __cmd__, int index) {
   return __self__.objectAtIndex(index);
 }
Beispiel #23
0
 @Callback
 @BindSelector("subarrayWithRange:")
 public static NSArray subarrayWithRange(
     NSArray __self__, Selector __cmd__, @ByVal NSRange range) {
   return __self__.subarrayWithRange(range);
 }
 public UISegmentedControl(String... items) {
   super((SkipInit) null);
   initObject(init(NSArray.fromStrings(items)));
 }
Beispiel #25
0
 @Callback
 @BindSelector("containsObject:")
 public static boolean containsObject(NSArray __self__, Selector __cmd__, NSObject anObject) {
   return __self__.containsObject(anObject);
 }
Beispiel #26
0
 @Override
 public int size() {
   return array.count();
 }
Beispiel #27
0
 @Callback
 @BindSelector("indexOfObject:")
 public static int indexOfObject(NSArray __self__, Selector __cmd__, NSObject anObject) {
   return __self__.indexOfObject(anObject);
 }