cynosurex.util
Class Set

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by cynosurex.util.Set
All Implemented Interfaces:
cynosurex.internal.AuthorCommon, cynosurex.internal.CommonInterface, cynosurex.internal.CompanyCommon, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class Set
extends java.util.Vector
implements cynosurex.internal.CommonInterface

This class simplifies set operation.

Author:
Chiao Cheng, Chieh Cheng
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface cynosurex.internal.CommonInterface
copyright, copyrightYears, notice, program, version
 
Fields inherited from interface cynosurex.internal.AuthorCommon
author, copyrightSymbol, noticeMsg, rights
 
Fields inherited from interface cynosurex.internal.CompanyCommon
company, email, website
 
Constructor Summary
Set()
          Public constructor to create a Set with no elements.
Set(Set set)
          Public constructor to create a Set with a list of element from another set.
 
Method Summary
 Set difference(Set set)
          Returns a Set object equal to the difference of this Set object and the Set object passed into the method.
 boolean has(java.lang.Object obj)
          Method to test whether an Object is in the Set.
 Set intersect(Set set)
          Returns a Set object equal to the intersection of this Set object and the Set object passed into the method.
 Set union(Set set)
          Returns a Set object equal to the union of this Set object and the Set object passed into the method.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Set

public Set()
Public constructor to create a Set with no elements.


Set

public Set(Set set)
Public constructor to create a Set with a list of element from another set.

Method Detail

has

public boolean has(java.lang.Object obj)
Method to test whether an Object is in the Set.


intersect

public Set intersect(Set set)
Returns a Set object equal to the intersection of this Set object and the Set object passed into the method.

Parameters:
set - is a Set object

union

public Set union(Set set)
Returns a Set object equal to the union of this Set object and the Set object passed into the method.

Parameters:
set - is a Set object

difference

public Set difference(Set set)
Returns a Set object equal to the difference of this Set object and the Set object passed into the method.

Parameters:
set - is a Set object