When setting new section I need to keep track of the counters. for example if m1 is Brass and I use setSection(Strings); I want it to Brass-- and Strings++ But I'm not sure how to do it with if statments and im not sure if getSection()toString() would get me the original section or not
/**This function sets a musician's Orchestra Section.
@param section is a SymphonySection indicating the musician's Orchestra Section.*/
public void setSection(SymphonySection section) {
this.section = section;
if (getSection().toString().equals( "Strings" )){
Strings--;
}
else if (getSection().toString().equals( "Brass" )){
Brass--;
}
else if (getSection().toString().equals( "Conductor" )){
Conductor--;
}
else if (getSection().toString().equals( "Percussion" )){
Percussion--;
}
else if (getSection().toString().equals( "WoodWinds" )){
WoodWinds--;
}
if (section.toString().equals( "Strings" )){
Strings++;
}
else if (section.toString().equals( "Brass" )){
Brass ++;
}
else if (section.toString().equals( "Conductor" )){
Conductor ++;
}
else if (section.toString().equals( "Percussion" )){
Percussion ++;
}
else if (section.toString().equals( "WoodWinds" )){
WoodWinds ++;
}
}