E - - type of array contentspublic class NSArray<E> extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, NSCoding, NSKeyValueCoding, NSKeyValueCodingAdditions, _NSFoundationCollection, java.util.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.SupportNSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.UtilityNSKeyValueCoding._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 java.lang.Class |
_CLASS |
protected int |
_hashCache |
protected static int |
_NSArrayClassHashCode |
protected java.lang.Object[] |
_objects |
static java.lang.String |
AverageOperatorName |
static boolean |
CheckForNull |
static java.lang.String |
CountOperatorName |
static NSArray |
EmptyArray |
static boolean |
IgnoreNull |
static java.lang.String |
MaximumOperatorName |
static java.lang.String |
MinimumOperatorName |
static int |
NotFound |
static java.lang.String |
SumOperatorName |
_KeyPathSeparatorChar, KeyPathSeparatorNullValue| Modifier | Constructor and Description |
|---|---|
|
NSArray() |
|
NSArray(java.util.Collection<? extends E> collection) |
|
NSArray(java.util.Collection<? extends E> collection,
boolean checkForNull) |
|
NSArray(E object) |
|
NSArray(E[] objects) |
|
NSArray(E[] objects,
NSRange range) |
|
NSArray(E object,
E... objects) |
|
NSArray(java.util.List<? extends E> list,
boolean checkForNull) |
|
NSArray(java.util.List<? extends E> list,
NSRange range,
boolean ignoreNull) |
|
NSArray(NSArray<? extends E> otherArray) |
protected |
NSArray(java.lang.Object[] objects,
int rangeLocation,
int rangeLength,
boolean checkForNull,
boolean ignoreNull) |
|
NSArray(java.util.Vector<? extends E> vector,
NSRange range,
boolean ignoreNull) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_initializeWithCapacity(int capacity) |
protected boolean |
_mustRecomputeHash() |
static NSMutableArray<java.lang.String> |
_mutableComponentsSeparatedByString(java.lang.String string,
java.lang.String separator) |
protected java.lang.Object[] |
_objects() |
protected void |
_setCount(int count) |
protected void |
_setMustRecomputeHash(boolean change) |
protected void |
_setObjects(java.lang.Object[] objects) |
int |
_shallowHashCode() |
boolean |
add(E element) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends E> collection) |
NSArray<E> |
arrayByAddingObject(E object) |
NSArray<E> |
arrayByAddingObjectsFromArray(NSArray<? extends E> otherArray) |
java.util.ArrayList<E> |
arrayList() |
java.lang.Class |
classForCoder() |
void |
clear() |
java.lang.Object |
clone() |
java.lang.String |
componentsJoinedByString(java.lang.String separator) |
static NSArray<java.lang.String> |
componentsSeparatedByString(java.lang.String string,
java.lang.String separator) |
boolean |
contains(java.lang.Object element) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsObject(java.lang.Object object) |
int |
count() |
static java.lang.Object |
decodeObject(NSCoder coder) |
static <T> NSArray<T> |
emptyArray() |
void |
encodeWithCoder(NSCoder coder) |
boolean |
equals(java.lang.Object object) |
E |
firstObjectCommonWithArray(NSArray<?> otherArray) |
E |
get(int index) |
void |
getObjects(java.lang.Object[] objects)
Deprecated.
use
objects() or objectsNoCopy() |
void |
getObjects(java.lang.Object[] objects,
NSRange range)
Deprecated.
use
objects(NSRange) |
int |
hashCode() |
NSArray<E> |
immutableClone() |
int |
indexOf(java.lang.Object element) |
int |
indexOfIdenticalObject(java.lang.Object object) |
int |
indexOfIdenticalObject(java.lang.Object object,
NSRange range) |
int |
indexOfObject(java.lang.Object object) |
int |
indexOfObject(java.lang.Object object,
NSRange range) |
boolean |
isEmpty() |
boolean |
isEqualToArray(NSArray<?> otherArray) |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object element) |
E |
lastObject() |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int index) |
void |
makeObjectsPerformSelector(NSSelector selector,
java.lang.Object... parameters) |
NSMutableArray<E> |
mutableClone() |
E |
objectAtIndex(int index) |
java.util.Enumeration<E> |
objectEnumerator() |
java.lang.Object[] |
objects() |
java.lang.Object[] |
objects(NSRange range) |
protected java.lang.Object[] |
objectsNoCopy() |
static NSArray.Operator |
operatorForKey(java.lang.String operatorName) |
static NSArray<java.lang.String> |
operatorNames() |
E |
remove(int index) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
static void |
removeOperatorForKey(java.lang.String operatorName) |
boolean |
retainAll(java.util.Collection<?> collection) |
java.util.Enumeration<E> |
reverseObjectEnumerator() |
E |
set(int index,
E element) |
static void |
setOperatorForKey(java.lang.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) |
java.util.List<E> |
subList(int fromIndex,
int toIndex) |
void |
takeValueForKey(java.lang.Object value,
java.lang.String key) |
void |
takeValueForKeyPath(java.lang.Object value,
java.lang.String keyPath) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] objects) |
java.lang.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>. |
java.lang.Object |
valueForKey(java.lang.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>. |
java.lang.Object |
valueForKeyPath(java.lang.String keyPath) |
java.util.Vector<E> |
vector() |
public static final java.lang.Class _CLASS
public static final int NotFound
public static final NSArray EmptyArray
public static final java.lang.String CountOperatorName
public static final java.lang.String MaximumOperatorName
public static final java.lang.String MinimumOperatorName
public static final java.lang.String SumOperatorName
public static final java.lang.String AverageOperatorName
protected static final int _NSArrayClassHashCode
protected java.lang.Object[] _objects
protected transient int _hashCache
public static final boolean CheckForNull
public static final boolean IgnoreNull
public NSArray()
public NSArray(E object)
protected NSArray(java.lang.Object[] objects,
int rangeLocation,
int rangeLength,
boolean checkForNull,
boolean ignoreNull)
public NSArray(E[] objects)
public NSArray(java.util.List<? extends E> list, boolean checkForNull)
public NSArray(java.util.Collection<? extends E> collection, boolean checkForNull)
public NSArray(java.util.Collection<? extends E> collection)
public static NSArray<java.lang.String> operatorNames()
public static void setOperatorForKey(java.lang.String operatorName,
NSArray.Operator arrayOperator)
public static NSArray.Operator operatorForKey(java.lang.String operatorName)
public static void removeOperatorForKey(java.lang.String operatorName)
protected void _initializeWithCapacity(int capacity)
protected void _setCount(int count)
protected java.lang.Object[] _objects()
protected void _setObjects(java.lang.Object[] objects)
protected java.lang.Object[] objectsNoCopy()
public int count()
public E objectAtIndex(int index)
public NSArray<E> arrayByAddingObjectsFromArray(NSArray<? extends E> otherArray)
public java.lang.Object[] objects()
public java.lang.Object[] objects(NSRange range)
public java.util.Vector<E> vector()
public java.util.ArrayList<E> arrayList()
public boolean containsObject(java.lang.Object object)
@Deprecated public void getObjects(java.lang.Object[] objects)
objects() or objectsNoCopy()@Deprecated
public void getObjects(java.lang.Object[] objects,
NSRange range)
objects(NSRange)public int indexOfObject(java.lang.Object object)
public int indexOfObject(java.lang.Object object,
NSRange range)
public int indexOfIdenticalObject(java.lang.Object object)
public int indexOfIdenticalObject(java.lang.Object object,
NSRange range)
public E lastObject()
public boolean isEqualToArray(NSArray<?> otherArray)
public boolean equals(java.lang.Object object)
public java.util.Enumeration<E> objectEnumerator()
public java.util.Enumeration<E> reverseObjectEnumerator()
@Deprecated public NSArray sortedArrayUsingSelector(NSSelector selector) throws NSComparator.ComparisonException
NSComparator.ComparisonExceptionpublic NSArray<E> sortedArrayUsingComparator(NSComparator comparator) throws NSComparator.ComparisonException
NSComparator.ComparisonExceptionpublic java.lang.String componentsJoinedByString(java.lang.String separator)
public static NSArray<java.lang.String> componentsSeparatedByString(java.lang.String string, java.lang.String separator)
public static NSMutableArray<java.lang.String> _mutableComponentsSeparatedByString(java.lang.String string, java.lang.String separator)
public java.lang.Object valueForKey(java.lang.String key)
valueForKey in interface NSKeyValueCodingpublic void takeValueForKey(java.lang.Object value,
java.lang.String key)
takeValueForKey in interface NSKeyValueCodingpublic java.lang.Object valueForKeyPath(java.lang.String keyPath)
valueForKeyPath in interface NSKeyValueCodingAdditionspublic void takeValueForKeyPath(java.lang.Object value,
java.lang.String keyPath)
takeValueForKeyPath in interface NSKeyValueCodingAdditionspublic java.lang.Class classForCoder()
classForCoder in interface NSCodingpublic static java.lang.Object decodeObject(NSCoder coder)
public void encodeWithCoder(NSCoder coder)
encodeWithCoder in interface NSCodingpublic void makeObjectsPerformSelector(NSSelector selector, java.lang.Object... parameters)
public int _shallowHashCode()
_shallowHashCode in interface _NSFoundationCollectionpublic int hashCode()
public java.lang.Object clone()
clone in class java.lang.Objectpublic NSMutableArray<E> mutableClone()
public java.lang.String toString()
toString in class java.lang.Objectprotected boolean _mustRecomputeHash()
protected void _setMustRecomputeHash(boolean change)
public boolean add(E element)
public boolean addAll(java.util.Collection<? extends E> collection)
public boolean addAll(int index,
java.util.Collection<? extends E> collection)
addAll in interface java.util.List<E>public boolean contains(java.lang.Object element)
public java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] objects)
public boolean containsAll(java.util.Collection<?> c)
public java.util.ListIterator<E> listIterator()
listIterator in interface java.util.List<E>public java.util.ListIterator<E> listIterator(int index)
listIterator in interface java.util.List<E>public int indexOf(java.lang.Object element)
indexOf in interface java.util.List<E>public int lastIndexOf(java.lang.Object element)
lastIndexOf in interface java.util.List<E>public boolean isEmpty()
public int size()
public boolean remove(java.lang.Object object)
public void clear()
public boolean retainAll(java.util.Collection<?> collection)
public boolean removeAll(java.util.Collection<?> collection)
public java.util.List<E> subList(int fromIndex, int toIndex)
subList in interface java.util.List<E>public static final <T> NSArray<T> emptyArray()
public <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 NSArrayerxKey - 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 NSArrayerxKey - 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 NSArrayerxKey - removeNulls - if true all NSKeyValueCoding.Null elements
will be removeddistinct - if true all duplicate elements will be
removedflatten - if true all NSArray elements will be
flattenedNSArray of T objects.Copyright © 2002 – 2022 Project Wonder.