com.webobjects.foundation
Class NSSet<E>
java.lang.Object
com.webobjects.foundation.NSSet<E>
- Type Parameters:
E - type of set contents
- All Implemented Interfaces:
- _NSFoundationCollection, NSCoding, Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>
- Direct Known Subclasses:
- NSMutableSet
public class NSSet<E>
- extends Object
- implements Cloneable, Serializable, NSCoding, _NSFoundationCollection, Set<E>
NSSet reimplementation to support JDK 1.5 templates. Use with
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));
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding |
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 |
_CLASS
public static final Class _CLASS
_NSSetClassHashCode
protected static int _NSSetClassHashCode
EmptySet
public static final NSSet EmptySet
_capacity
protected transient int _capacity
_count
protected transient int _count
_deletionLimit
protected transient int _deletionLimit
_flags
protected transient byte[] _flags
_hashCache
protected transient int _hashCache
_hashtableBuckets
protected transient int _hashtableBuckets
_objects
protected Object[] _objects
_objectsCache
protected transient Object[] _objectsCache
NSSet
public NSSet()
NSSet
public NSSet(Collection<? extends E> collection)
NSSet
public NSSet(NSArray<? extends E> objects)
NSSet
public NSSet(NSSet<? extends E> otherSet)
NSSet
public NSSet(Set<? extends E> set,
boolean ignoreNull)
NSSet
public NSSet(E object)
NSSet
public NSSet(E[] objects)
NSSet
public NSSet(E object,
E... objects)
decodeObject
public static Object decodeObject(NSCoder coder)
_allObjects
public Object[] _allObjects()
_clearDeletionsAndCollisions
protected void _clearDeletionsAndCollisions()
_ensureCapacity
protected void _ensureCapacity(int capacity)
_initializeSet
protected void _initializeSet()
_shallowHashCode
public int _shallowHashCode()
- Specified by:
_shallowHashCode in interface _NSFoundationCollection
add
public boolean add(E o)
- Specified by:
add in interface Collection<E>- Specified by:
add in interface Set<E>
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll in interface Collection<E>- Specified by:
addAll in interface Set<E>
allObjects
public NSArray<E> allObjects()
anyObject
public E anyObject()
classForCoder
public Class classForCoder()
- Specified by:
classForCoder in interface NSCoding
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Specified by:
clear in interface Set<E>
clone
public Object clone()
- Overrides:
clone in class Object
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<E>- Specified by:
contains in interface Set<E>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll in interface Collection<E>- Specified by:
containsAll in interface Set<E>
containsObject
public boolean containsObject(Object object)
count
public int count()
_setCount
protected void _setCount(int count)
capacity
protected int capacity()
_setCapacity
protected void _setCapacity(int capacity)
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoder in interface NSCoding
emptySet
public static <T> NSSet<T> emptySet()
equals
public boolean equals(Object object)
- Specified by:
equals in interface Collection<E>- Specified by:
equals in interface Set<E>- Overrides:
equals in class Object
hashCode
public int hashCode()
- Specified by:
hashCode in interface Collection<E>- Specified by:
hashCode in interface Set<E>- Overrides:
hashCode in class Object
hashSet
public HashSet<E> hashSet()
immutableClone
public NSSet<E> immutableClone()
intersectsSet
public boolean intersectsSet(NSSet<?> otherSet)
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<E>- Specified by:
isEmpty in interface Set<E>
isEqualToSet
public boolean isEqualToSet(NSSet<?> otherSet)
isSubsetOfSet
public boolean isSubsetOfSet(NSSet<?> otherSet)
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in interface Set<E>
member
public E member(Object object)
mutableClone
public NSMutableSet<E> mutableClone()
objectEnumerator
public Enumeration<E> objectEnumerator()
objectsNoCopy
protected Object[] objectsNoCopy()
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface Set<E>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll in interface Collection<E>- Specified by:
removeAll in interface Set<E>
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll in interface Collection<E>- Specified by:
retainAll in interface Set<E>
setByIntersectingSet
public NSSet<E> setByIntersectingSet(NSSet<?> otherSet)
setBySubtractingSet
public NSSet<E> setBySubtractingSet(NSSet<?> otherSet)
setByUnioningSet
public NSSet<E> setByUnioningSet(NSSet<? extends E> otherSet)
size
public int size()
- Specified by:
size in interface Collection<E>- Specified by:
size in interface Set<E>
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection<E>- Specified by:
toArray in interface Set<E>
toArray
public <T> T[] toArray(T[] objects)
- Specified by:
toArray in interface Collection<E>- Specified by:
toArray in interface Set<E>
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2002 – 2011 Project Wonder.