public NSMutableData insert(long location, ByteBuffer bytes) { return replace(new NSRange(location, 0), bytes); }
public boolean equalsTo(NSRange other) { return getLocation() == other.getLocation() && getLength() == other.getLength(); } @Override
@Override public boolean equals(Object obj) { return obj instanceof NSRange && equalsTo((NSRange)obj); } /*<methods>*/
public NSRange(@MachineSizedUInt long location, @MachineSizedUInt long length) { this.setLocation(location); this.setLength(length); } /*</constructors>*/
@Override public boolean shouldChangeCharacters (UITextField textField, NSRange range, String string) { for (int i = 0; i < range.getLength(); i++) { app.input.inputProcessor.keyTyped((char)8); } if (string.isEmpty()) { if (range.getLength() > 0) Gdx.graphics.requestRendering(); return false; } char[] chars = new char[string.length()]; string.getChars(0, string.length(), chars, 0); for (int i = 0; i < chars.length; i++) { app.input.inputProcessor.keyTyped(chars[i]); } Gdx.graphics.requestRendering(); return true; }
/** * @since Available in iOS 4.0 and later. */ public static NSTextCheckingResult getRegularExpressionCheckingResult(NSRange[] ranges, NSRegularExpression regularExpression) { NSRange first = Struct.allocate(NSRange.class, ranges.length); first.update(ranges); return getRegularExpressionCheckingResult(first, ranges.length, regularExpression); }
@Override public boolean shouldChangeCharacters (UITextField textField, NSRange range, String string) { for (int i = 0; i < range.getLength(); i++) { app.input.inputProcessor.keyTyped((char)8); } if (string.isEmpty()) { if (range.getLength() > 0) Gdx.graphics.requestRendering(); return false; } char[] chars = new char[string.length()]; string.getChars(0, string.length(), chars, 0); for (int i = 0; i < chars.length; i++) { app.input.inputProcessor.keyTyped(chars[i]); } Gdx.graphics.requestRendering(); return true; }
public NSRange(@MachineSizedUInt long location, @MachineSizedUInt long length) { this.setLocation(location); this.setLength(length); } /*</constructors>*/
/** * @since Available in iOS 4.0 and later. */ public static NSTextCheckingResult getRegularExpressionCheckingResult(NSRange[] ranges, NSRegularExpression regularExpression) { NSRange first = Struct.allocate(NSRange.class, ranges.length); first.update(ranges); return getRegularExpressionCheckingResult(first, ranges.length, regularExpression); }
public boolean isLocationInRange(long location) { return (!(location < getLocation()) && (location - getLocation()) < getLength()); }
public NSMutableData insert(long location, byte[] bytes, int offset, int length) { return replace(new NSRange(location, 0), bytes, offset, length); }
public NSRange(@MachineSizedUInt long location, @MachineSizedUInt long length) { this.setLocation(location); this.setLength(length); } /*</constructors>*/
/** * @since Available in iOS 4.0 and later. */ public static NSTextCheckingResult getRegularExpressionCheckingResult(NSRange[] ranges, NSRegularExpression regularExpression) { NSRange first = Struct.allocate(NSRange.class, ranges.length); first.update(ranges); return getRegularExpressionCheckingResult(first, ranges.length, regularExpression); }
@Override public boolean equals(Object obj) { return obj instanceof NSRange && equalsTo((NSRange)obj); } /*<methods>*/
public long getMaxRange() { return getLocation() + getLength(); }
public NSMutableData insert(long location, byte[] bytes) { return replace(new NSRange(location, 0), bytes, 0, bytes.length); }
/** * @since Available in iOS 7.0 and later. */ public int[] getIndexes(NSRange positionRange) { int n = (int) getLength(); MachineSizedUIntPtr p = Struct.allocate(MachineSizedUIntPtr.class, (int)positionRange.getLength()); getIndexes(p, positionRange); return p.toIntArray(n); }
@Override public boolean equals(Object obj) { return obj instanceof NSRange && equalsTo((NSRange)obj); } /*<methods>*/
public boolean equalsTo(NSRange other) { return getLocation() == other.getLocation() && getLength() == other.getLength(); } @Override