public class SymphonySection
extends java.lang.Object
// create a couple of SymphonySection objects SymphonySection Section = SymphonySection.WoodWind; SymphonySection otherSection = null; // set a SymphonySection Section = SymphonySection.Strings; // copy a SymphonySection otherSection = Section; // compare SymphonySection objects if(Section == SymphonySection.Brass) { // treat a SymphonySection as a String System.out.println("Musician is in the " + Section + " section"); }
Modifier and Type | Field and Description |
---|---|
static SymphonySection |
Brass
Use this constant to indicate that a musician is
a member of the Brass section.
|
static SymphonySection |
Conductor
Use this constant to indicate that a musician is
the Conductor (which places him or her in
a section all their own).
|
static SymphonySection |
Percussion
Use this constant to indicate that a musician is
a member of the Percussion section.
|
static SymphonySection |
Strings
Use this constant to indicate that a musician is
a member of the Strings section.
|
static SymphonySection |
WoodWinds
Use this constant to indicate that a musician is
a member of the WoodWinds section.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(SymphonySection otherSection)
This inherited function tests whether two
SymphonySection objects are really the same.
|
static SymphonySection |
findSectionFromEnumeration(int enumeration)
This function will return a SymphonySection object corresponding
to the enumeration number provided.
|
static int |
getEnumerationCounter()
This function returns the static EnumerationCounter
value, which equals the number of SymphonySections
that have been created.
|
static void |
listSections()
This function lists all of the Symphony Sections
(including both the Enumeration Numbers and Section Names)
to System.out.
|
static void |
main(java.lang.String[] args)
This main() function is used merely for testing
this SymphonySection class.
|
java.lang.String |
toString()
This inherited function returns the name of this
section as a human-readable String.
|
public static final SymphonySection Strings
public static final SymphonySection Brass
public static final SymphonySection WoodWinds
public static final SymphonySection Percussion
public static final SymphonySection Conductor
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(SymphonySection otherSection)
public static void listSections()
public static SymphonySection findSectionFromEnumeration(int enumeration)
enumeration
- Is a number representing an individual SymphonySection class.public static int getEnumerationCounter()
public static void main(java.lang.String[] args)