java.lang.Object
com.sun.jna.Structure
ca.weblite.objc.foundation.NSRange
- Direct Known Subclasses:
NSRange.ByReference,NSRange.ByValue
public class NSRange
extends com.sun.jna.Structure
A structure mapping to the Foundation structure NSRange. If you need to call a method that
receives an NSRange as an input, you can use this structure.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.sun.jna.Structure
com.sun.jna.Structure.FieldOrder, com.sun.jna.Structure.StructField -
Field Summary
FieldsFields inherited from class com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the length as a signed int.intGets the location.voidsetLength(int len) Sets the length of the range.voidsetLocation(int loc) Sets the location of the range.Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
Field Details
-
location
public long locationThe location. WARNING: This stores an unsigned integer value. UsegetLocation()andsetLocation(int)to properly convert to/from Java's signed ints. -
length
public long lengthThe length. WARNING: This stores an unsigned integer value. UsegetLength()andsetLength(int)to properly convert to/from Java's signed ints.
-
-
Constructor Details
-
NSRange
public NSRange()
-
-
Method Details
-
setLocation
public void setLocation(int loc) Sets the location of the range.- Parameters:
loc- The location.
-
setLength
public void setLength(int len) Sets the length of the range.- Parameters:
len- The length of the range.
-
getLocation
public int getLocation()Gets the location. Prefer this accessor to direct access oflocationbecauselocationstores is unsigned, so the value will seem nonsensical.- Returns:
- The location as a signed int.
-
getLength
public int getLength()Gets the length as a signed int.- Returns:
- The length as a signed int.
-
getFieldOrder
- Overrides:
getFieldOrderin classcom.sun.jna.Structure
-