net.wotonomy.foundation
Class NSSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet
              extended by net.wotonomy.foundation.NSSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set

public class NSSet
extends java.util.HashSet

A pure java implementation of NSSet that implements Set for greater java interoperability.

Version:
$Revision: 893 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Constructor Summary
NSSet()
          Default constructor.
NSSet(java.util.Collection aCollection)
          Constructs a NSSet containing the objects in the specified collection.
NSSet(java.lang.Object anObject)
          Constructs a NSSet containing only the specified object.
NSSet(java.lang.Object[] anObjectArray)
          Constructs a NSSet containing the objects in the specified array.
 
Method Summary
 NSArray allObjects()
          Returns an NSArray containing all objects in the set.
 java.lang.Object anyObject()
           
 boolean containsObject(java.lang.Object anObject)
          Returns whether this set contains the specified object.
 int count()
          Returns the number of elements in this set.
 boolean intersectsSet(java.util.Set aSet)
          Returns whether this set has one or more elements in common with the specified set.
 boolean isEqualToSet(java.util.Set aSet)
          Returns whether this set contains the same object as the specified set.
 boolean isSubsetOfSet(java.util.Set aSet)
          Returns whether this set is a subset of the specified set.
 java.lang.Object member(java.lang.Object anObject)
           
 java.util.Enumeration objectEnumerator()
          Returns an enumerator over the objects in this set.
 NSSet setByIntersectingSet(java.util.Set aSet)
          Returns a set that is the intersection of this set and the specified set.
 NSSet setBySubtractingSet(java.util.Set aSet)
          Returns a set that contains all elements in this set that are not in the specified set.
 NSSet setByUnioningSet(java.util.Set aSet)
          Returns a set that is the union of this set and the specified set.
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

NSSet

public NSSet()
Default constructor.


NSSet

public NSSet(java.util.Collection aCollection)
Constructs a NSSet containing the objects in the specified collection.


NSSet

public NSSet(java.lang.Object anObject)
Constructs a NSSet containing only the specified object.


NSSet

public NSSet(java.lang.Object[] anObjectArray)
Constructs a NSSet containing the objects in the specified array.

Method Detail

allObjects

public NSArray allObjects()
Returns an NSArray containing all objects in the set.


anyObject

public java.lang.Object anyObject()

containsObject

public boolean containsObject(java.lang.Object anObject)
Returns whether this set contains the specified object.


count

public int count()
Returns the number of elements in this set.


intersectsSet

public boolean intersectsSet(java.util.Set aSet)
Returns whether this set has one or more elements in common with the specified set.


isEqualToSet

public boolean isEqualToSet(java.util.Set aSet)
Returns whether this set contains the same object as the specified set.


isSubsetOfSet

public boolean isSubsetOfSet(java.util.Set aSet)
Returns whether this set is a subset of the specified set.


member

public java.lang.Object member(java.lang.Object anObject)

objectEnumerator

public java.util.Enumeration objectEnumerator()
Returns an enumerator over the objects in this set.


setByIntersectingSet

public NSSet setByIntersectingSet(java.util.Set aSet)
Returns a set that is the intersection of this set and the specified set.


setBySubtractingSet

public NSSet setBySubtractingSet(java.util.Set aSet)
Returns a set that contains all elements in this set that are not in the specified set.


setByUnioningSet

public NSSet setByUnioningSet(java.util.Set aSet)
Returns a set that is the union of this set and the specified set.



Copyright © 2006 null. All Rights Reserved.