package uk.ac.ebi.pride.cluster.ws.modules.cluster.util;

/**
 * @author Jose A. Dianes <jdianes@ebi.ac.uk>
 */
public class SpeciesCount {
    private String speciesName;
    private long speciesCount;

    public SpeciesCount(String speciesName, long speciesCount) {
        this.speciesName = speciesName;
        this.speciesCount = speciesCount;
    }

    public String getSpeciesName() {
        return speciesName;
    }

    public void setSpeciesName(String speciesName) {
        this.speciesName = speciesName;
    }

    public long getSpeciesCount() {
        return speciesCount;
    }

    public void setSpeciesCount(long speciesCount) {
        this.speciesCount = speciesCount;
    }


    public void addSpeciesCount(long n) {
        this.speciesCount += n;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SpeciesCount)) return false;

        SpeciesCount that = (SpeciesCount) o;

        if (speciesCount != that.speciesCount) return false;
        if (speciesName != null ? !speciesName.equals(that.speciesName) : that.speciesName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = speciesName != null ? speciesName.hashCode() : 0;
        result = 31 * result + (int) (speciesCount ^ (speciesCount >>> 32));
        return result;
    }

    @Override
    public String toString() {
        return "SpeciesCount{" +
                "speciesName='" + speciesName + '\'' +
                ", speciesCount=" + speciesCount +
                '}';
    }
}

@@ -178,32 +178,25 @@
 rivate long 
-speciesC
+c
 ount;%0A%0A    p
@@ -235,32 +235,25 @@
 sName, long 
-speciesC
+c
 ount) %7B%0A    
@@ -301,39 +301,25 @@
    this.
-speciesCount = speciesC
+count = c
 ount;%0A  
@@ -514,23 +514,16 @@
 long get
-Species
 Count() 
@@ -539,24 +539,17 @@
  return 
-speciesC
+c
 ount;%0A  
@@ -572,23 +572,16 @@
 void set
-Species
 Count(lo
@@ -583,24 +583,17 @@
 nt(long 
-speciesC
+c
 ount) %7B%0A
@@ -609,31 +609,17 @@
 his.
-speciesCount = speciesC
+count = c
 ount
@@ -683,24 +683,17 @@
    this.
-speciesC
+c
 ount += 
@@ -906,24 +906,17 @@
     if (
-speciesC
+c
 ount != 
@@ -920,24 +920,17 @@
 != that.
-speciesC
+c
 ount) re
@@ -1239,32 +1239,18 @@
 t) (
-speciesCount %5E (speciesC
+count %5E (c
 ount
@@ -1442,24 +1442,17 @@
      %22, 
-speciesC
+c
 ount=%22 +
@@ -1456,16 +1456,9 @@
 %22 + 
-speciesC
+c
 ount

change both the species and the modification chats to have limited amount of items, and group the others into "Others" category