E
- - type of array contentspublic class NSArray<E> extends Object implements Cloneable, Serializable, com.webobjects.foundation.NSCoding, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation._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 |
com.webobjects.foundation.NSCoding._BigDecimalSupport, com.webobjects.foundation.NSCoding._BigIntegerSupport, com.webobjects.foundation.NSCoding._BooleanSupport, com.webobjects.foundation.NSCoding._ByteSupport, com.webobjects.foundation.NSCoding._CharacterSupport, com.webobjects.foundation.NSCoding._DateSupport, com.webobjects.foundation.NSCoding._DoubleSupport, com.webobjects.foundation.NSCoding._FloatSupport, com.webobjects.foundation.NSCoding._IntegerSupport, com.webobjects.foundation.NSCoding._LongSupport, com.webobjects.foundation.NSCoding._NumberSupport, com.webobjects.foundation.NSCoding._ShortSupport, com.webobjects.foundation.NSCoding._StringSupport, com.webobjects.foundation.NSCoding.Support
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.MapImplementation, com.webobjects.foundation.NSKeyValueCoding.Null<T>, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.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 |
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,
com.webobjects.foundation.NSRange range) |
|
NSArray(E object,
E... objects) |
|
NSArray(List<? extends E> list,
boolean checkForNull) |
|
NSArray(List<? extends E> list,
com.webobjects.foundation.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,
com.webobjects.foundation.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(com.webobjects.foundation.NSCoder coder) |
static <T> NSArray<T> |
emptyArray() |
void |
encodeWithCoder(com.webobjects.foundation.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,
com.webobjects.foundation.NSRange range)
Deprecated.
use
objects(NSRange) |
int |
hashCode() |
NSArray<E> |
immutableClone() |
int |
indexOf(Object element) |
int |
indexOfIdenticalObject(Object object) |
int |
indexOfIdenticalObject(Object object,
com.webobjects.foundation.NSRange range) |
int |
indexOfObject(Object object) |
int |
indexOfObject(Object object,
com.webobjects.foundation.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(com.webobjects.foundation.NSSelector selector,
Object... parameters) |
NSMutableArray<E> |
mutableClone() |
E |
objectAtIndex(int index) |
Enumeration<E> |
objectEnumerator() |
Object[] |
objects() |
Object[] |
objects(com.webobjects.foundation.NSRange range) |
protected Object[] |
objectsNoCopy() |
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(com.webobjects.foundation.NSComparator comparator) |
NSArray |
sortedArrayUsingSelector(com.webobjects.foundation.NSSelector selector)
Deprecated.
Method sortedArrayUsingSelector is deprecated
|
NSArray<E> |
subarrayWithRange(com.webobjects.foundation.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(E[] objects, com.webobjects.foundation.NSRange range)
public NSArray(Collection<? extends E> collection, boolean checkForNull)
public NSArray(Collection<? extends E> collection)
public NSArray(List<? extends E> list, com.webobjects.foundation.NSRange range, boolean ignoreNull)
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 Object[] objects(com.webobjects.foundation.NSRange range)
public boolean containsObject(Object object)
@Deprecated public void getObjects(Object[] objects)
objects()
or objectsNoCopy()
@Deprecated public void getObjects(Object[] objects, com.webobjects.foundation.NSRange range)
objects(NSRange)
public int indexOfObject(Object object)
public int indexOfObject(Object object, com.webobjects.foundation.NSRange range)
public int indexOfIdenticalObject(Object object)
public int indexOfIdenticalObject(Object object, com.webobjects.foundation.NSRange range)
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(com.webobjects.foundation.NSSelector selector) throws com.webobjects.foundation.NSComparator.ComparisonException
com.webobjects.foundation.NSComparator.ComparisonException
public NSArray<E> sortedArrayUsingComparator(com.webobjects.foundation.NSComparator comparator) throws com.webobjects.foundation.NSComparator.ComparisonException
com.webobjects.foundation.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 com.webobjects.foundation.NSKeyValueCoding
public void takeValueForKey(Object value, String key)
takeValueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
public Object valueForKeyPath(String keyPath)
valueForKeyPath
in interface com.webobjects.foundation.NSKeyValueCodingAdditions
public void takeValueForKeyPath(Object value, String keyPath)
takeValueForKeyPath
in interface com.webobjects.foundation.NSKeyValueCodingAdditions
public Class classForCoder()
classForCoder
in interface com.webobjects.foundation.NSCoding
public static Object decodeObject(com.webobjects.foundation.NSCoder coder)
public void encodeWithCoder(com.webobjects.foundation.NSCoder coder)
encodeWithCoder
in interface com.webobjects.foundation.NSCoding
public void makeObjectsPerformSelector(com.webobjects.foundation.NSSelector selector, Object... parameters)
public int _shallowHashCode()
_shallowHashCode
in interface com.webobjects.foundation._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 <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 – 2020 Project Wonder.