E
- - type of array contentspublic class NSArray<E> extends Object implements Cloneable, Serializable, NSCoding, NSKeyValueCoding, NSKeyValueCodingAdditions, _NSFoundationCollection, List<E>
NSArray<Bug> bugs = ds.fetchObjects();
for(Bug : bugs) {
...
}
Modifier and Type | Class and Description |
---|---|
static class |
NSArray._AvgNumberOperator |
static class |
NSArray._CountOperator |
static class |
NSArray._MaxOperator |
static class |
NSArray._MinOperator |
static class |
NSArray._Operator |
static class |
NSArray._SumNumberOperator |
static interface |
NSArray.Operator |
NSCoding._BigDecimalSupport, NSCoding._BigIntegerSupport, NSCoding._BooleanSupport, NSCoding._ByteSupport, NSCoding._CharacterSupport, NSCoding._DateSupport, NSCoding._DoubleSupport, NSCoding._FloatSupport, NSCoding._IntegerSupport, NSCoding._LongSupport, NSCoding._NumberSupport, NSCoding._ShortSupport, NSCoding._StringSupport, NSCoding.Support
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
Modifier and Type | Field and Description |
---|---|
static Class |
_CLASS |
protected int |
_hashCache |
protected static int |
_NSArrayClassHashCode |
protected Object[] |
_objects |
static String |
AverageOperatorName |
static boolean |
CheckForNull |
static String |
CountOperatorName |
static NSArray |
EmptyArray |
static boolean |
IgnoreNull |
static String |
MaximumOperatorName |
static String |
MinimumOperatorName |
static int |
NotFound |
static String |
SumOperatorName |
_KeyPathSeparatorChar, KeyPathSeparator
NullValue
Modifier | Constructor and Description |
---|---|
|
NSArray() |
|
NSArray(Collection<? extends E> collection) |
|
NSArray(Collection<? extends E> collection,
boolean checkForNull) |
|
NSArray(E object) |
|
NSArray(E[] objects) |
|
NSArray(E[] objects,
NSRange range) |
|
NSArray(E object,
E... objects) |
|
NSArray(List<? extends E> list,
boolean checkForNull) |
|
NSArray(List<? extends E> list,
NSRange range,
boolean ignoreNull) |
|
NSArray(NSArray<? extends E> otherArray) |
protected |
NSArray(Object[] objects,
int rangeLocation,
int rangeLength,
boolean checkForNull,
boolean ignoreNull) |
|
NSArray(Vector<? extends E> vector,
NSRange range,
boolean ignoreNull) |
Modifier and Type | Method and Description |
---|---|
protected void |
_initializeWithCapacity(int capacity) |
protected boolean |
_mustRecomputeHash() |
static NSMutableArray<String> |
_mutableComponentsSeparatedByString(String string,
String separator) |
protected Object[] |
_objects() |
protected void |
_setCount(int count) |
protected void |
_setMustRecomputeHash(boolean change) |
protected void |
_setObjects(Object[] objects) |
int |
_shallowHashCode() |
boolean |
add(E element) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> collection) |
boolean |
addAll(int index,
Collection<? extends E> collection) |
NSArray<E> |
arrayByAddingObject(E object) |
NSArray<E> |
arrayByAddingObjectsFromArray(NSArray<? extends E> otherArray) |
ArrayList<E> |
arrayList() |
Class |
classForCoder() |
void |
clear() |
Object |
clone() |
String |
componentsJoinedByString(String separator) |
static NSArray<String> |
componentsSeparatedByString(String string,
String separator) |
boolean |
contains(Object element) |
boolean |
containsAll(Collection<?> c) |
boolean |
containsObject(Object object) |
int |
count() |
static Object |
decodeObject(NSCoder coder) |
static <T> NSArray<T> |
emptyArray() |
void |
encodeWithCoder(NSCoder coder) |
boolean |
equals(Object object) |
E |
firstObjectCommonWithArray(NSArray<?> otherArray) |
E |
get(int index) |
void |
getObjects(Object[] objects)
Deprecated.
use
objects() or objectsNoCopy() |
void |
getObjects(Object[] objects,
NSRange range)
Deprecated.
use
objects(NSRange) |
int |
hashCode() |
NSArray<E> |
immutableClone() |
int |
indexOf(Object element) |
int |
indexOfIdenticalObject(Object object) |
int |
indexOfIdenticalObject(Object object,
NSRange range) |
int |
indexOfObject(Object object) |
int |
indexOfObject(Object object,
NSRange range) |
boolean |
isEmpty() |
boolean |
isEqualToArray(NSArray<?> otherArray) |
Iterator<E> |
iterator() |
int |
lastIndexOf(Object element) |
E |
lastObject() |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
void |
makeObjectsPerformSelector(NSSelector selector,
Object... parameters) |
NSMutableArray<E> |
mutableClone() |
E |
objectAtIndex(int index) |
Enumeration<E> |
objectEnumerator() |
Object[] |
objects() |
Object[] |
objects(NSRange range) |
protected Object[] |
objectsNoCopy() |
static <E> NSArray<E> |
of()
Returns an immutable empty
NSArray . |
static <E> NSArray<E> |
of(E... elements)
Returns an immutable
NSArray containing an arbitrary number of elements. |
static <E> NSArray<E> |
of(E element)
Returns an immutable
NSArray containing one element. |
static NSArray.Operator |
operatorForKey(String operatorName) |
static NSArray<String> |
operatorNames() |
E |
remove(int index) |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> collection) |
static void |
removeOperatorForKey(String operatorName) |
boolean |
retainAll(Collection<?> collection) |
Enumeration<E> |
reverseObjectEnumerator() |
E |
set(int index,
E element) |
static void |
setOperatorForKey(String operatorName,
NSArray.Operator arrayOperator) |
int |
size() |
NSArray<E> |
sortedArrayUsingComparator(NSComparator comparator) |
NSArray |
sortedArrayUsingSelector(NSSelector selector)
Deprecated.
Method sortedArrayUsingSelector is deprecated
|
NSArray<E> |
subarrayWithRange(NSRange range) |
List<E> |
subList(int fromIndex,
int toIndex) |
void |
takeValueForKey(Object value,
String key) |
void |
takeValueForKeyPath(Object value,
String keyPath) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] objects) |
String |
toString() |
<T> NSArray<T> |
valueForKey(ERXKey<T> erxKey)
A type-safe wrapper for
valueForKey(String) that automatically
does the following (in order) to the resulting array prior to returning
it:
remove
NSKeyValueCoding.Null elements
flatten all elements that
are arrays (Only if ERXKey.isToManyRelationship()
returns true , which can only possibly happen if
ERXKey.type() has been set.)
remove all duplicate
objects
|
<T> NSArray<T> |
valueForKey(ERXKey<T> erxKey,
boolean removeNulls,
boolean distinct,
boolean flatten)
A type-safe wrapper for
valueForKeyPath(String) that calls
valueForKeyPath(erxKey.key()) and attempts to cast the result to
NSArray<T> . |
Object |
valueForKey(String key) |
<T> NSArray<T> |
valueForKeyPath(ERXKey<T> erxKey)
A type-safe wrapper for
valueForKeyPath(String) that simply
calls valueForKeyPath(erxKey.key()) and attempts to cast the
result to NSArray<T> . |
Object |
valueForKeyPath(String keyPath) |
Vector<E> |
vector() |
finalize, getClass, notify, notifyAll, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
public static final Class _CLASS
public static final int NotFound
public static final NSArray EmptyArray
public static final String CountOperatorName
public static final String MaximumOperatorName
public static final String MinimumOperatorName
public static final String SumOperatorName
public static final String AverageOperatorName
protected static final int _NSArrayClassHashCode
protected Object[] _objects
protected transient int _hashCache
public static final boolean CheckForNull
public static final boolean IgnoreNull
public NSArray()
public NSArray(E object)
protected NSArray(Object[] objects, int rangeLocation, int rangeLength, boolean checkForNull, boolean ignoreNull)
public NSArray(E[] objects)
public NSArray(Collection<? extends E> collection, boolean checkForNull)
public NSArray(Collection<? extends E> collection)
public static void setOperatorForKey(String operatorName, NSArray.Operator arrayOperator)
public static NSArray.Operator operatorForKey(String operatorName)
public static void removeOperatorForKey(String operatorName)
protected void _initializeWithCapacity(int capacity)
protected void _setCount(int count)
protected Object[] _objects()
protected void _setObjects(Object[] objects)
protected Object[] objectsNoCopy()
public int count()
public E objectAtIndex(int index)
public NSArray<E> arrayByAddingObjectsFromArray(NSArray<? extends E> otherArray)
public Object[] objects()
public boolean containsObject(Object object)
@Deprecated public void getObjects(Object[] objects)
objects()
or objectsNoCopy()
@Deprecated public void getObjects(Object[] objects, NSRange range)
objects(NSRange)
public int indexOfObject(Object object)
public int indexOfIdenticalObject(Object object)
public E lastObject()
public boolean isEqualToArray(NSArray<?> otherArray)
public boolean equals(Object object)
public Enumeration<E> objectEnumerator()
public Enumeration<E> reverseObjectEnumerator()
@Deprecated public NSArray sortedArrayUsingSelector(NSSelector selector) throws NSComparator.ComparisonException
NSComparator.ComparisonException
public NSArray<E> sortedArrayUsingComparator(NSComparator comparator) throws NSComparator.ComparisonException
NSComparator.ComparisonException
public static NSArray<String> componentsSeparatedByString(String string, String separator)
public static NSMutableArray<String> _mutableComponentsSeparatedByString(String string, String separator)
public Object valueForKey(String key)
valueForKey
in interface NSKeyValueCoding
public void takeValueForKey(Object value, String key)
takeValueForKey
in interface NSKeyValueCoding
public Object valueForKeyPath(String keyPath)
valueForKeyPath
in interface NSKeyValueCodingAdditions
public void takeValueForKeyPath(Object value, String keyPath)
takeValueForKeyPath
in interface NSKeyValueCodingAdditions
public Class classForCoder()
classForCoder
in interface NSCoding
public void encodeWithCoder(NSCoder coder)
encodeWithCoder
in interface NSCoding
public void makeObjectsPerformSelector(NSSelector selector, Object... parameters)
public int _shallowHashCode()
_shallowHashCode
in interface _NSFoundationCollection
public int hashCode()
public NSMutableArray<E> mutableClone()
protected boolean _mustRecomputeHash()
protected void _setMustRecomputeHash(boolean change)
public boolean add(E element)
public boolean addAll(Collection<? extends E> collection)
public boolean addAll(int index, Collection<? extends E> collection)
public boolean contains(Object element)
public Object[] toArray()
public <T> T[] toArray(T[] objects)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
public int lastIndexOf(Object element)
lastIndexOf
in interface List<E>
public boolean isEmpty()
public int size()
public boolean remove(Object object)
public void clear()
public boolean retainAll(Collection<?> collection)
public boolean removeAll(Collection<?> collection)
public static final <T> NSArray<T> emptyArray()
public static <E> NSArray<E> of()
NSArray
.E
- the NSArray
's element typeNSArray
public static <E> NSArray<E> of(E element)
NSArray
containing one element.E
- the NSArray
's element typeelement
- the element to be contained in the arrayNSArray
containing the specified element@SafeVarargs public static <E> NSArray<E> of(E... elements)
NSArray
containing an arbitrary number of elements.E
- the NSArray
's element typeelements
- the elements to be contained in the arrayNSArray
containing the specified elementspublic <T> NSArray<T> valueForKeyPath(ERXKey<T> erxKey)
valueForKeyPath(String)
that simply
calls valueForKeyPath(erxKey.key())
and attempts to cast the
result to NSArray<T>
. If the value returned cannot be cast it
will throw a ClassCastException
.T
- the Type of elements in the returned NSArray
erxKey
- NSArray
of T
objects.public <T> NSArray<T> valueForKey(ERXKey<T> erxKey)
valueForKey(String)
that automatically
does the following (in order) to the resulting array prior to returning
it:
remove
NSKeyValueCoding.Null
elementsflatten
all elements that
are arrays (Only if ERXKey.isToManyRelationship()
returns true
, which can only possibly happen if
ERXKey.type()
has been set.)remove
all duplicate
objectsT
- the Type of elements in the returned NSArray
erxKey
- NSArray
of T
objects.public <T> NSArray<T> valueForKey(ERXKey<T> erxKey, boolean removeNulls, boolean distinct, boolean flatten)
valueForKeyPath(String)
that calls
valueForKeyPath(erxKey.key())
and attempts to cast the result to
NSArray<T>
.
Then, depending upon the parameters,
remove
NSKeyValueCoding.Null
elementsflatten
all elements that
are arrays (Only if ERXKey.isToManyRelationship()
returns true
, which can only possibly happen if
ERXKey.type()
has been set.)remove
all duplicate
objects
If the value cannot be cast it will throw a ClassCastException
.
T
- the Type of elements in the returned NSArray
erxKey
- removeNulls
- if true
all NSKeyValueCoding.Null
elements
will be removed
distinct
- if true
all duplicate elements will be
removed
flatten
- if true
all NSArray
elements will be
flattened
NSArray
of T
objects.Copyright © 2002 – 2024 Project Wonder.