Class NSArray<_ObjectType>

    • Constructor Detail

      • NSArray

        protected NSArray​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static NSArray<?> alloc()
      • allocWithZone

        public static NSArray<?> allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • array

        public static <_ObjectType> NSArray<?> array()
      • arrayWithArray

        public static <_ObjectType> NSArray<?> arrayWithArray​(@NotNull
                                                              @NotNull NSArray<_ObjectType> array)
      • arrayWithContentsOfFile

        @Nullable
        @Deprecated
        public static <_ObjectType> @Nullable NSArray<_ObjectType> arrayWithContentsOfFile​(@NotNull
                                                                                           @NotNull java.lang.String path)
        Deprecated.
        These methods are deprecated, and will be marked with API_DEPRECATED in a subsequent release. Use the variants that use errors instead. API-Since: 2.0 Deprecated-Since: 100000.0
      • arrayWithContentsOfURL

        @Nullable
        @Deprecated
        public static <_ObjectType> @Nullable NSArray<_ObjectType> arrayWithContentsOfURL​(@NotNull
                                                                                          @NotNull NSURL url)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 100000.0
      • arrayWithObject

        public static <_ObjectType> NSArray<?> arrayWithObject​(@NotNull
                                                               _ObjectType anObject)
      • arrayWithObjects

        public static <_ObjectType> NSArray<?> arrayWithObjects​(@NotNull
                                                                _ObjectType firstObj,
                                                                java.lang.Object... varargs)
      • arrayWithObjectsCount

        public static <_ObjectType> NSArray<?> arrayWithObjectsCount​(@NotNull
                                                                     @NotNull org.moe.natj.general.ptr.Ptr<_ObjectType> objects,
                                                                     long cnt)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • new_objc

        public static NSArray<?> new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static <_ObjectType> boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • addObserverForKeyPathOptionsContext

        public void addObserverForKeyPathOptionsContext​(@NotNull
                                                        @NotNull NSObject observer,
                                                        @NotNull
                                                        @NotNull java.lang.String keyPath,
                                                        long options,
                                                        @Nullable
                                                        @Nullable org.moe.natj.general.ptr.VoidPtr context)
        NSArrays are not observable, so these methods raise exceptions when invoked on NSArrays. Instead of observing an array, observe the ordered to-many relationship for which the array is the collection of related objects.
        Overrides:
        addObserverForKeyPathOptionsContext in class NSObject
      • addObserverToObjectsAtIndexesForKeyPathOptionsContext

        public void addObserverToObjectsAtIndexesForKeyPathOptionsContext​(@NotNull
                                                                          @NotNull NSObject observer,
                                                                          @NotNull
                                                                          @NotNull NSIndexSet indexes,
                                                                          @NotNull
                                                                          @NotNull java.lang.String keyPath,
                                                                          long options,
                                                                          @Nullable
                                                                          @Nullable org.moe.natj.general.ptr.VoidPtr context)
        Register or deregister as an observer of the values at a key path relative to each indexed element of the array. The options determine what is included in observer notifications and when they're sent, as described above, and the context is passed in observer notifications as described above. These are not merely convenience methods; invoking them is potentially much faster than repeatedly invoking NSObject(NSKeyValueObserverRegistration) methods. You should use -removeObserver:fromObjectsAtIndexes:forKeyPath:context: instead of -removeObserver:fromObjectsAtIndexes:forKeyPath: whenever possible for the same reason described in the NSObject(NSKeyValueObserverRegistration) comment.
      • componentsJoinedByString

        @NotNull
        public @NotNull java.lang.String componentsJoinedByString​(@NotNull
                                                                  @NotNull java.lang.String separator)
      • containsObject

        public boolean containsObject​(@NotNull
                                      _ObjectType anObject)
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • count

        public long count()
      • countByEnumeratingWithStateObjectsCount

        public long countByEnumeratingWithStateObjectsCount​(@NotNull
                                                            @NotNull org.moe.natj.general.ptr.VoidPtr state,
                                                            @NotNull
                                                            @NotNull org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer,
                                                            long len)
        Specified by:
        countByEnumeratingWithStateObjectsCount in interface NSFastEnumeration
      • descriptionWithLocale

        @NotNull
        public @NotNull java.lang.String descriptionWithLocale​(@Nullable
                                                               @Nullable java.lang.Object locale)
      • descriptionWithLocaleIndent

        @NotNull
        public @NotNull java.lang.String descriptionWithLocaleIndent​(@Nullable
                                                                     @Nullable java.lang.Object locale,
                                                                     long level)
      • filteredArrayUsingPredicate

        @NotNull
        public @NotNull NSArray<_ObjectType> filteredArrayUsingPredicate​(@NotNull
                                                                         @NotNull NSPredicate predicate)
        evaluate a predicate against an array of objects and return a filtered array
      • firstObject

        @Nullable
        public _ObjectType firstObject()
        API-Since: 4.0
      • getObjects

        @Deprecated
        public void getObjects​(@NotNull
                               @NotNull org.moe.natj.general.ptr.Ptr<_ObjectType> objects)
        Deprecated.
        This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. API-Since: 2.0 Deprecated-Since: 11.0 Deprecated-Message: Use -getObjects:range: instead
      • getObjectsRange

        public void getObjectsRange​(@NotNull
                                    @NotNull org.moe.natj.general.ptr.Ptr<_ObjectType> objects,
                                    NSRange range)
      • indexOfObject

        public long indexOfObject​(@NotNull
                                  _ObjectType anObject)
      • indexOfObjectInRange

        public long indexOfObjectInRange​(@NotNull
                                         _ObjectType anObject,
                                         NSRange range)
      • indexOfObjectIdenticalTo

        public long indexOfObjectIdenticalTo​(@NotNull
                                             _ObjectType anObject)
      • indexOfObjectIdenticalToInRange

        public long indexOfObjectIdenticalToInRange​(@NotNull
                                                    _ObjectType anObject,
                                                    NSRange range)
      • initWithArrayCopyItems

        public NSArray<?> initWithArrayCopyItems​(@NotNull
                                                 @NotNull NSArray<_ObjectType> array,
                                                 boolean flag)
      • initWithContentsOfFile

        @Nullable
        @Deprecated
        public @Nullable NSArray<_ObjectType> initWithContentsOfFile​(@NotNull
                                                                     @NotNull java.lang.String path)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 100000.0
      • initWithContentsOfURL

        @Nullable
        @Deprecated
        public @Nullable NSArray<_ObjectType> initWithContentsOfURL​(@NotNull
                                                                    @NotNull NSURL url)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 100000.0
      • initWithObjects

        public NSArray<?> initWithObjects​(@NotNull
                                          _ObjectType firstObj,
                                          java.lang.Object... varargs)
      • initWithObjectsCount

        public NSArray<?> initWithObjectsCount​(@Nullable
                                               @Nullable org.moe.natj.general.ptr.Ptr<_ObjectType> objects,
                                               long cnt)
      • isEqualToArray

        public boolean isEqualToArray​(@NotNull
                                      @NotNull NSArray<_ObjectType> otherArray)
      • lastObject

        @Nullable
        public _ObjectType lastObject()
      • makeObjectsPerformSelector

        public void makeObjectsPerformSelector​(@NotNull
                                               @NotNull org.moe.natj.objc.SEL aSelector)
      • makeObjectsPerformSelectorWithObject

        public void makeObjectsPerformSelectorWithObject​(@NotNull
                                                         @NotNull org.moe.natj.objc.SEL aSelector,
                                                         @Nullable
                                                         @Nullable java.lang.Object argument)
      • mutableCopyWithZone

        @NotNull
        public @NotNull java.lang.Object mutableCopyWithZone​(@Nullable
                                                             @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        mutableCopyWithZone in interface NSMutableCopying
      • objectAtIndex

        @NotNull
        public _ObjectType objectAtIndex​(long index)
      • objectAtIndexedSubscript

        @NotNull
        public _ObjectType objectAtIndexedSubscript​(long idx)
        API-Since: 6.0
      • pathsMatchingExtensions

        @NotNull
        public @NotNull NSArray<java.lang.String> pathsMatchingExtensions​(@NotNull
                                                                          @NotNull NSArray<java.lang.String> filterTypes)
      • removeObserverForKeyPath

        public void removeObserverForKeyPath​(@NotNull
                                             @NotNull NSObject observer,
                                             @NotNull
                                             @NotNull java.lang.String keyPath)
        Overrides:
        removeObserverForKeyPath in class NSObject
      • removeObserverForKeyPathContext

        public void removeObserverForKeyPathContext​(@NotNull
                                                    @NotNull NSObject observer,
                                                    @NotNull
                                                    @NotNull java.lang.String keyPath,
                                                    @Nullable
                                                    @Nullable org.moe.natj.general.ptr.VoidPtr context)
        API-Since: 5.0
        Overrides:
        removeObserverForKeyPathContext in class NSObject
      • removeObserverFromObjectsAtIndexesForKeyPath

        public void removeObserverFromObjectsAtIndexesForKeyPath​(@NotNull
                                                                 @NotNull NSObject observer,
                                                                 @NotNull
                                                                 @NotNull NSIndexSet indexes,
                                                                 @NotNull
                                                                 @NotNull java.lang.String keyPath)
      • removeObserverFromObjectsAtIndexesForKeyPathContext

        public void removeObserverFromObjectsAtIndexesForKeyPathContext​(@NotNull
                                                                        @NotNull NSObject observer,
                                                                        @NotNull
                                                                        @NotNull NSIndexSet indexes,
                                                                        @NotNull
                                                                        @NotNull java.lang.String keyPath,
                                                                        @Nullable
                                                                        @Nullable org.moe.natj.general.ptr.VoidPtr context)
        API-Since: 5.0
      • setValueForKey

        public void setValueForKey​(@Nullable
                                   @Nullable java.lang.Object value,
                                   @NotNull
                                   @NotNull java.lang.String key)
        Invoke -setValue:forKey: on each of the receiver's elements.
        Overrides:
        setValueForKey in class NSObject
      • shuffledArray

        @NotNull
        public @NotNull NSArray<_ObjectType> shuffledArray()
        Returns a shuffled instance of this array using the systems underlying random source, as with [GKRandomSource sharedRandom]
      • shuffledArrayWithRandomSource

        @NotNull
        public @NotNull NSArray<_ObjectType> shuffledArrayWithRandomSource​(@NotNull
                                                                           @NotNull GKRandomSource randomSource)
        Returns a shuffled instance of this array using the given random source.
      • sortedArrayHint

        @NotNull
        public @NotNull NSData sortedArrayHint()
      • sortedArrayUsingDescriptors

        @NotNull
        public @NotNull NSArray<_ObjectType> sortedArrayUsingDescriptors​(@NotNull
                                                                         @NotNull NSArray<? extends NSSortDescriptor> sortDescriptors)
        returns a new array by sorting the objects of the receiver
      • sortedArrayUsingSelector

        @NotNull
        public @NotNull NSArray<_ObjectType> sortedArrayUsingSelector​(@NotNull
                                                                      @NotNull org.moe.natj.objc.SEL comparator)
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • valueForKey

        @NotNull
        public @NotNull java.lang.Object valueForKey​(@NotNull
                                                     @NotNull java.lang.String key)
        Return an array containing the results of invoking -valueForKey: on each of the receiver's elements. The returned array will contain NSNull elements for each instance of -valueForKey: returning nil.
        Overrides:
        valueForKey in class NSObject
      • writeToFileAtomically

        @Deprecated
        public boolean writeToFileAtomically​(@NotNull
                                             @NotNull java.lang.String path,
                                             boolean useAuxiliaryFile)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 100000.0
      • writeToURLAtomically

        @Deprecated
        public boolean writeToURLAtomically​(@NotNull
                                            @NotNull NSURL url,
                                            boolean atomically)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 100000.0
      • add

        public boolean add​(_ObjectType e)
        Specified by:
        add in interface java.util.Collection<_ObjectType>
        Specified by:
        add in interface java.util.List<_ObjectType>
      • add

        public void add​(int index,
                        _ObjectType element)
        Specified by:
        add in interface java.util.List<_ObjectType>
      • addAll

        public boolean addAll​(java.util.Collection<? extends _ObjectType> c)
        Specified by:
        addAll in interface java.util.Collection<_ObjectType>
        Specified by:
        addAll in interface java.util.List<_ObjectType>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends _ObjectType> c)
        Specified by:
        addAll in interface java.util.List<_ObjectType>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<_ObjectType>
        Specified by:
        clear in interface java.util.List<_ObjectType>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<_ObjectType>
        Specified by:
        contains in interface java.util.List<_ObjectType>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<_ObjectType>
        Specified by:
        containsAll in interface java.util.List<_ObjectType>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<_ObjectType>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<_ObjectType>
        Specified by:
        isEmpty in interface java.util.List<_ObjectType>
      • iterator

        public java.util.Iterator<_ObjectType> iterator()
        Specified by:
        iterator in interface java.util.Collection<_ObjectType>
        Specified by:
        iterator in interface java.lang.Iterable<_ObjectType>
        Specified by:
        iterator in interface java.util.List<_ObjectType>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<_ObjectType>
      • listIterator

        public java.util.ListIterator<_ObjectType> listIterator()
        Specified by:
        listIterator in interface java.util.List<_ObjectType>
      • listIterator

        public java.util.ListIterator<_ObjectType> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<_ObjectType>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<_ObjectType>
        Specified by:
        remove in interface java.util.List<_ObjectType>
      • remove

        public _ObjectType remove​(int index)
        Specified by:
        remove in interface java.util.List<_ObjectType>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<_ObjectType>
        Specified by:
        removeAll in interface java.util.List<_ObjectType>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<_ObjectType>
        Specified by:
        retainAll in interface java.util.List<_ObjectType>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<_ObjectType>
        Specified by:
        size in interface java.util.List<_ObjectType>
      • subList

        public java.util.List<_ObjectType> subList​(int fromIndex,
                                                   int toIndex)
        Specified by:
        subList in interface java.util.List<_ObjectType>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<_ObjectType>
        Specified by:
        toArray in interface java.util.List<_ObjectType>
      • toArray

        public java.lang.Object[] toArray​(java.lang.Object[] a)
        Specified by:
        toArray in interface java.util.Collection<_ObjectType>
        Specified by:
        toArray in interface java.util.List<_ObjectType>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<_ObjectType>
        Specified by:
        hashCode in interface java.util.List<_ObjectType>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<_ObjectType>
        Specified by:
        equals in interface java.util.List<_ObjectType>
        Overrides:
        equals in class org.moe.natj.objc.ObjCObject
      • arrayWithContentsOfURLError

        @Nullable
        public static <_ObjectType> @Nullable NSArray<_ObjectType> arrayWithContentsOfURLError​(@NotNull
                                                                                               @NotNull NSURL url,
                                                                                               @Nullable
                                                                                               @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Reads array stored in NSPropertyList format from the specified url. API-Since: 11.0
      • initWithContentsOfURLError

        @Nullable
        public @Nullable NSArray<_ObjectType> initWithContentsOfURLError​(@NotNull
                                                                         @NotNull NSURL url,
                                                                         @Nullable
                                                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Reads array stored in NSPropertyList format from the specified url. API-Since: 11.0
      • writeToURLError

        public boolean writeToURLError​(@NotNull
                                       @NotNull NSURL url,
                                       @Nullable
                                       @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Serializes this instance to the specified URL in the NSPropertyList format (using NSPropertyListXMLFormat_v1_0). For other formats use NSPropertyListSerialization directly. API-Since: 11.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.