Class NSRange

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 Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from class com.sun.jna.Structure

    com.sun.jna.Structure.FieldOrder, com.sun.jna.Structure.StructField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    long
    The length.
    long
    The location.

    Fields inherited from class com.sun.jna.Structure

    ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<String>
     
    int
    Gets the length as a signed int.
    int
    Gets the location.
    void
    setLength(int len)
    Sets the length of the range.
    void
    setLocation(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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • location

      public long location
      The location. WARNING: This stores an unsigned integer value. Use getLocation() and setLocation(int) to properly convert to/from Java's signed ints.
    • length

      public long length
      The length. WARNING: This stores an unsigned integer value. Use getLength() and setLength(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 of location because location stores 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

      protected List<String> getFieldOrder()
      Overrides:
      getFieldOrder in class com.sun.jna.Structure