/* Generated by Together */

package cobalt.deployment.descriptor.dist;

import java.util.ArrayList;

public class Jeus30SecurityRole {
    public Jeus30SecurityRole(String roleName) {
        this.roleName = roleName;
        users = new ArrayList();
    }

    public String getRoleName(){ return roleName; }

    public void setRoleName(String roleName){ this.roleName = roleName; }

    public ArrayList getUsers(){ return users; }

    public void setUsers(ArrayList users){ this.users = users; }

    public void putUser(String user) {
        if ( !containsUser(user) )
            users.add(user);
    }

    public void removeUser(String user) {
        users.remove(user);
    }

    public boolean containsUser(String user) {
        return users.contains(user);
	}

	public void changeUser(String oldUser, String newUser) {
		int pos = users.indexOf(oldUser);
		users.remove(pos);
		users.add(pos, newUser);
	}

    public int getUserSize() {
        return users.size();
    }

    public String getUserAt(int index) {
        return (String)users.get(index);
    }

    private String roleName;
    private ArrayList users;
}
