public class Musician
extends java.lang.Object
Constructor and Description |
---|
Musician(Musician otherMusician)
This copy constructor creates a new Musician object copying
the relevant details from another Musician object.
|
Musician(java.lang.String name,
java.lang.String instrument,
java.lang.String office,
SymphonySection section,
boolean principle)
This function constructs a new Musician object using the
provided parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Musician other)
The function equals properly compares Musician objects.
|
java.lang.String |
getInstrument()
This function returns the musician's instrument.
|
java.lang.String |
getName()
This function returns the musician's name.
|
java.lang.String |
getOffice()
This function returns the musician's office number.
|
SymphonySection |
getSection()
This function returns the musician's Orchestra Section.
|
boolean |
isPrinciple()
This function indicates whether the musician is the Principle of their section.
|
static void |
main(java.lang.String[] args)
Some code to test our class.
|
void |
setInstrument(java.lang.String instrument)
This function sets a musician's Instrument.
|
void |
setName(java.lang.String name)
This function sets a musician's Name.
|
void |
setOffice(java.lang.String office)
This function sets a musician's Office number.
|
void |
setPrinciple(boolean principle)
This function sets whether a musician is the Principle of their section.
|
void |
setSection(SymphonySection section)
This function sets a musician's Orchestra Section.
|
java.lang.String |
toString()
The function toString outputs detailed information for
the Musician class.
|
public Musician(java.lang.String name, java.lang.String instrument, java.lang.String office, SymphonySection section, boolean principle)
name
- Is the name to assign to the new Musician.instrument
- Is the instrument to assign to the new Musician.office
- Is the office number to assign to the new Musician.section
- Is the SymphonySection to assign to the new Musician.principle
- Is a boolean indicating whether the new Musician is the Principle of his or her section.public Musician(Musician otherMusician)
otherMusician
- Another Musician object to make a copy of.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(Musician other)
public java.lang.String getName()
public java.lang.String getInstrument()
public java.lang.String getOffice()
public SymphonySection getSection()
public boolean isPrinciple()
public void setName(java.lang.String name)
name
- is a String representing the musician's name.public void setInstrument(java.lang.String instrument)
instrument
- is a String representing the musician's instrument.public void setOffice(java.lang.String office)
office
- is a String representing the musician's Office number.public void setSection(SymphonySection section)
section
- is a SymphonySection indicating the musician's Orchestra Section.public void setPrinciple(boolean principle)
principle
- is a boolean that indicates whether the musician is the Principle of their section.public static void main(java.lang.String[] args)