import java.util.ArrayList;
	

public class Chromosome {
	private String _name;
	ArrayList<AlignedPARCLIPread> _readList = new ArrayList<AlignedPARCLIPread>(1000000);
	
	
	public Chromosome(String chromosome) {
		_name = chromosome;
	}
	public String getName() {
		return _name;
	}
	
	
	
	public void addRead( AlignedPARCLIPread read ) {
		if( _readList.contains(read) ) {
			int i = _readList.indexOf(read);
			AlignedPARCLIPread currentRead = _readList.get(i);
			currentRead.incorporateMap(read.getConversionMap());
			currentRead.addCount(read.getReadCount());
			_readList.set(i, currentRead);
		}
		else { _readList.add(read); }
	}
	public ArrayList<AlignedPARCLIPread> getReadList() {
		return _readList;
	}
	

	
	
//***************************************************************			
// For Comparing...	
	@Override
	public boolean equals( Object other ) {
		if( other == null || getClass() != other.getClass() ) { return false; }
		if( other == this ) { return true; }
		final Chromosome otherChromosome = (Chromosome) other;
		if( otherChromosome.getName().equals(getName()) ) {
			return true;
		}
		return false;
	}
	@Override
	public int hashCode() {
		return _name.hashCode();
	}
//***************************************************************			
	
	
	
	
}
