FileDocCategorySizeDatePackage
OrderedSet.javaAPI DocGlassfish v2 API2959Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

OrderedSet

public class OrderedSet extends Vector implements Set
I am an ordered collection that does not allow duplicates.
author
Danny Coward

Fields Summary
Constructors Summary
public OrderedSet()
Construct an empty collection.

	
public OrderedSet(Collection c)
Construct an ordered set from the given collection.

	    this();
	    this.addAll(c);
	
Methods Summary
public booleanadd(java.lang.Object o)
Add the given object to the Set if it is not equal (equals()) to an element already in the set.

	    if (o != null && !this.contains(o)) {
		return super.add(o);
	    }
	    return false;
	
public booleanaddAll(java.util.Collection c)
Add all the elements in the given set that are not already in this ordered set.

	    boolean setChanged = false;
	    if (c != null) {
		for (Iterator itr = c.iterator(); itr.hasNext();) {
		    if (this.add(itr.next())) {
			setChanged = true;
		    }
		}
	    }
	    return setChanged;