E
- - type of set contentspublic class NSSet<E> extends Object implements Cloneable, Serializable, NSCoding, _NSFoundationCollection, Set<E>
NSSet<E> setA = new NSSet<E>(NSArray<E> listA);
NSSet<E> setB = new NSSet<E>(NSArray<E> listB);
logger.debug("intersection contains " + setA.setByIntersectingSet(setB));
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
Modifier and Type | Field and Description |
---|---|
protected int |
_capacity |
static Class |
_CLASS |
protected int |
_count |
protected int |
_deletionLimit |
protected byte[] |
_flags |
protected int |
_hashCache |
protected int |
_hashtableBuckets |
protected static int |
_NSSetClassHashCode |
protected Object[] |
_objects |
protected Object[] |
_objectsCache |
static NSSet |
EmptySet |
Constructor and Description |
---|
NSSet() |
NSSet(Collection<? extends E> collection) |
NSSet(E object) |
NSSet(E[] objects) |
NSSet(E object,
E... objects) |
NSSet(NSArray<? extends E> objects) |
NSSet(NSSet<? extends E> otherSet) |
NSSet(Set<? extends E> set,
boolean ignoreNull) |
Modifier and Type | Method and Description |
---|---|
Object[] |
_allObjects() |
protected void |
_clearDeletionsAndCollisions() |
protected void |
_ensureCapacity(int capacity) |
protected void |
_initializeSet() |
protected void |
_setCapacity(int capacity) |
protected void |
_setCount(int count) |
int |
_shallowHashCode() |
boolean |
add(E o) |
boolean |
addAll(Collection<? extends E> c) |
NSArray<E> |
allObjects() |
E |
anyObject() |
protected int |
capacity() |
Class |
classForCoder() |
void |
clear() |
Object |
clone() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
containsObject(Object object) |
int |
count() |
static Object |
decodeObject(NSCoder coder) |
static <T> NSSet<T> |
emptySet() |
void |
encodeWithCoder(NSCoder coder) |
boolean |
equals(Object object) |
int |
hashCode() |
HashSet<E> |
hashSet() |
NSSet<E> |
immutableClone() |
boolean |
intersectsSet(NSSet<?> otherSet) |
boolean |
isEmpty() |
boolean |
isEqualToSet(NSSet<?> otherSet) |
boolean |
isSubsetOfSet(NSSet<?> otherSet) |
Iterator<E> |
iterator() |
E |
member(Object object) |
NSMutableSet<E> |
mutableClone() |
Enumeration<E> |
objectEnumerator() |
protected Object[] |
objectsNoCopy() |
static <E> NSSet<E> |
of()
Returns an immutable empty
NSSet . |
static <E> NSSet<E> |
of(E... elements)
Returns an immutable
NSSet containing an arbitrary number of elements. |
static <E> NSSet<E> |
of(E element)
Returns an immutable
NSSet containing one element. |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
NSSet<E> |
setByIntersectingSet(NSSet<?> otherSet) |
NSSet<E> |
setBySubtractingSet(NSSet<?> otherSet) |
NSSet<E> |
setByUnioningSet(NSSet<? extends E> otherSet) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] objects) |
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf, stream
public static final Class _CLASS
protected static int _NSSetClassHashCode
public static final NSSet EmptySet
protected transient int _capacity
protected transient int _count
protected transient int _deletionLimit
protected transient byte[] _flags
protected transient int _hashCache
protected transient int _hashtableBuckets
protected Object[] _objects
protected transient Object[] _objectsCache
public NSSet()
public NSSet(Collection<? extends E> collection)
public NSSet(E object)
public NSSet(E[] objects)
public Object[] _allObjects()
protected void _clearDeletionsAndCollisions()
protected void _ensureCapacity(int capacity)
protected void _initializeSet()
public int _shallowHashCode()
_shallowHashCode
in interface _NSFoundationCollection
public boolean add(E o)
public boolean addAll(Collection<? extends E> c)
public E anyObject()
public Class classForCoder()
classForCoder
in interface NSCoding
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean containsObject(Object object)
public int count()
protected void _setCount(int count)
protected int capacity()
protected void _setCapacity(int capacity)
public void encodeWithCoder(NSCoder coder)
encodeWithCoder
in interface NSCoding
public static <T> NSSet<T> emptySet()
public static <E> NSSet<E> of()
NSSet
.E
- the NSSet
's element typeNSSet
public static <E> NSSet<E> of(E element)
NSSet
containing one element.E
- the NSSet
's element typeelement
- the element to be contained in the arrayNSSet
containing the specified element@SafeVarargs public static <E> NSSet<E> of(E... elements)
NSSet
containing an arbitrary number of elements.E
- the NSSet
's element typeelements
- the elements to be contained in the arrayNSSet
containing the specified elementspublic boolean equals(Object object)
public int hashCode()
public boolean intersectsSet(NSSet<?> otherSet)
public boolean isEmpty()
public boolean isEqualToSet(NSSet<?> otherSet)
public boolean isSubsetOfSet(NSSet<?> otherSet)
public NSMutableSet<E> mutableClone()
public Enumeration<E> objectEnumerator()
protected Object[] objectsNoCopy()
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] objects)
Copyright © 2002 – 2024 Project Wonder.