/*
 * Created on May 12, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.kellegous.mas864.clusterss;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

/**
 * @author knorton
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Cluster implements List {
	private String		name;
	private List			members;
	private int			subdiv=1;
	private double		quality=Double.MAX_VALUE;
	
	public Cluster() {
        this.members = new ArrayList();
	}
	
	public Cluster(String name) {
		this.name = name;
	}
	
	public Cluster(List members) {
		this.members = members;
	}
	
	public Cluster(String name, List members) {
		this.members = members;
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
    public void setName(String name) {
    	    this.name = name;   
    }
    
	public String toString() {
		return this.name;
	}
	
	public Article get(int i, List map) {
		return (Article)map.get(((Integer)this.members.get(i)).intValue());
	}

	public void incSubdiv() {
	    this.subdiv++;
	}
	
	public int getSubDiv() {
	    return this.subdiv;
	}
	
	public void setSubdiv(int i) {
	    this.subdiv = i;
	}
	
	public double getQuality() {
	    return this.quality;
	}
	
	public void setQuality(double quality) {
	    this.quality = quality;
	}
	
    /*** List ***/
    public void add(int arg0, Object arg1) {
        this.members.add(arg0,arg1);
    }
    
    public boolean add(Object arg0) {
        return this.members.add(arg0);
    }
    
    public boolean addAll(Collection arg0) {
        return this.members.addAll(arg0);
    }
    
    public boolean addAll(int arg0, Collection arg1) {
        return this.members.addAll(arg0,arg1);
    }
    
    public void clear() {
        this.members.clear();
    }
    
    public boolean contains(Object arg0) {
        return this.members.contains(arg0);
    }
    
    public boolean containsAll(Collection arg0) {
        return this.members.containsAll(arg0);
    }
    
    public Object get(int arg0) {
        return this.members.get(arg0);
    }
    
    public int indexOf(Object arg0) {
        return this.members.indexOf(arg0);
    }
    
    public boolean isEmpty() {
        return this.members.isEmpty();
    }
    
    public Iterator iterator() {
        return this.members.iterator();
    }
    
    public int lastIndexOf(Object arg0) {
        return this.members.lastIndexOf(arg0);
    }
    
    public ListIterator listIterator() {
        return this.members.listIterator();
    }
    
    public ListIterator listIterator(int arg0) {
        return this.members.listIterator(arg0);
    }
    
    public Object remove(int arg0) {
        return this.members.remove(arg0);
    }
    
    public boolean remove(Object arg0) {
        return this.members.remove(arg0);
    }
    
    public boolean removeAll(Collection arg0) {
        return this.members.removeAll(arg0);
    }
    
    public boolean retainAll(Collection arg0) {
        return this.members.retainAll(arg0);
    }
    
    public Object set(int arg0, Object arg1) {
        return this.members.set(arg0,arg1);
    }
    
    public int size() {
        return this.members.size();
    }
    
    public List subList(int arg0, int arg1) {
        return this.members.subList(arg0,arg1);
    }
    
    public Object[] toArray() {
    	    return this.members.toArray();
    }
    
    public Object[] toArray(Object[] arg0) {
        return this.members.toArray(arg0);
    }
    
}
