public List<String> asStringList() { List<String> list = new ArrayList<>(); if (size() == 0) return list; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { list.add(str.toString()); } return list; }
/** * Use this method to convert a NSSet of NSString items to a Set of String items. * Elements of this NSASet must be of type NSString, otherwise an exception will be thrown. * @return * @throws UnsupportedOperationException when the set items are not of type NSString. */ public Set<String> asStringSet() { Set<String> set = new HashSet<>(); if (size() == 0) return set; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { set.add(str.toString()); } return set; }
public List<String> asStringList() { List<String> list = new ArrayList<>(); if (size() == 0) return list; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { list.add(str.toString()); } return list; }
public List<String> asStringList() { List<String> list = new ArrayList<>(); if (size() == 0) return list; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { list.add(str.toString()); } return list; }
/** * Use this method to convert a NSSet of NSString items to a Set of String items. * Elements of this NSASet must be of type NSString, otherwise an exception will be thrown. * @return * @throws UnsupportedOperationException when the set items are not of type NSString. */ public Set<String> asStringSet() { Set<String> set = new HashSet<>(); if (size() == 0) return set; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { set.add(str.toString()); } return set; }
/** * Use this method to convert a NSSet of NSString items to a Set of String items. * Elements of this NSASet must be of type NSString, otherwise an exception will be thrown. * @return * @throws UnsupportedOperationException when the set items are not of type NSString. */ public Set<String> asStringSet() { Set<String> set = new HashSet<>(); if (size() == 0) return set; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { set.add(str.toString()); } return set; }
private Touch.Event[] toEvents (NSSet<UITouch> touches, UIEvent event, Touch.Event.Kind kind) { final Touch.Event[] events = new Touch.Event[touches.size()]; int idx = 0; for (UITouch touch : touches) { CGPoint loc = touch.getLocationInView(touch.getView()); // transform the point based on our current scale IPoint xloc = plat.graphics().transformTouch((float)loc.getX(), (float)loc.getY()); // on iOS the memory address of the UITouch object is the unique id int id = (int)touch.getHandle(); events[idx++] = new Touch.Event(0, touch.getTimestamp() * 1000, xloc.x(), xloc.y(), kind, id); } return events; } }
private Event.Impl[] toTouchEvents(NSSet<UITouch> touches, UIEvent event) { final Event.Impl[] events = new Event.Impl[touches.size()]; int idx = 0; for (UITouch touch : touches) { CGPoint loc = touch.getLocationInView(touch.getView()); // transform the point based on our current scale IPoint xloc = platform.graphics().transformTouch((float)loc.getX(), (float)loc.getY()); // on iOS the memory address of the UITouch object is the unique id int id = (int)touch.getHandle(); events[idx++] = new Event.Impl( new Events.Flags.Impl(), touch.getTimestamp() * 1000, xloc.x(), xloc.y(), id); } return events; } }