FileDocCategorySizeDatePackage
IntSet.javaAPI DocGlassfish v2 API2886Fri May 04 22:32:10 BST 2007com.sun.enterprise.util.collection

IntSet

public class IntSet extends Object

Fields Summary
int[]
members
int
size
Constructors Summary
public IntSet()

    	
      
    
Methods Summary
public booleanadd(int value)

		for (int i=0; i<size; i++) {
			if (members[i] == value) {
				return false;
			}
		}
			
		if (size == members.length) {
			int[] temp = new int[size + 4];
			System.arraycopy(members, 0, temp, 0, size);
			members = temp;
		}
		members[size++] = value;
		return true;
	
public booleancontains(int value)

		for (int i=0; i<size; i++) {
			if (members[i] == value) {
				return true;
			}
		}
		return false;
	
public int[]getMembers()

		return members;
	
public booleanremove(int value)

		for (int i=0; i<size; i++) {
			if (members[i] == value) {
				for (int j=i+1; j<size; j++) {
					members[j-1] = members[j];
				}
				return true;
			}
		}
		return false;
	
public intsize()

		return size;