FileDocCategorySizeDatePackage
Set.javaAPI DocJ2ME CLDC 1.11551Wed Feb 05 15:56:04 GMT 2003util

Set

public class Set extends Object

Fields Summary
private static final int
defaultInitial
int
ninitial
Vector
setData
Constructors Summary
public Set(int nin)


        
    ninitial = nin;
    
public Set()

    ninitial = defaultInitial;
    
Methods Summary
public voidadd(java.lang.Object o)

 addElement( o ); 
public voidaddElement(java.lang.Object o)

    // see if its already in. If not,
    // add at end.
    if ( isIn( o ) ) return;

    // now add, extending if necessary.
    if ( setData == null ){
        setData = new Vector( ninitial );
    }
    setData.addElement( o );
    
public voiddeleteAllElements()

    setData = null;
    
public java.util.Enumerationelements()

    return (setData==null)?EmptyEnumeration.instance:setData.elements();
    
public booleanisIn(java.lang.Object o)

    return (setData==null)?false:setData.contains( o );
    
public intsize()

 return (setData==null)?0:setData.size();