/*
 * @(#)BreedI.java
 *
 * Summary: example use of Enum, with method implemented a different way for each enum constant.
 *
 * Copyright: (c) 2009 Roedy Green, Canadian Mind Products, http://mindprod.com
 *
 * Licence: This software may be copied and used freely for any purpose but military.
 *          http://mindprod.com/contact/nonmil.html
 *
 * Requires: JDK 1.6+
 *
 * Created with: IntelliJ IDEA IDE.
 *
 * Version History:
 *  1.0 2006-03-02
 */
package com.mindprod.example;

/**
 * example use of Enum, with method implemented a different way for each enum constant.
 *
 * @author Roedy Green, Canadian Mind Products
 * @version 1.0 2006-03-02
 * @since 2006-03-02
 */
@SuppressWarnings( { "UnusedAssignment", "UnusedDeclaration", "WeakerAccess" } )
public enum BreedI
    {
    // Usually you list enum constants in alphabetical order.
    // Eclipse will put them in alphabetical order when you do
    // a Source Sort Members.

        /**
         * Dachshund smooth or curly
         */
        DACHSHUND( "brown" ),

        /**
         * Dalmatian
         */
        DALMATIAN( "spotted" )
                {
                // begin DALMATIAN inner class

                /**
                 * typical spots on a Dalmatian
                 */
                private final int spots = 50;

                /**
                 * Method getSpotcount is Defined only for DALMATIAN. Get
                 * typical count of spots on a Dalmatian
                 *
                 * @return spot count
                 */
                int getSpotCount()
                    {
                    return spots;
                    }

                // end DALMATIAN inner class
                },

        /**
         * Labrador all sizes
         */
        LABRADOR( "black or tan" );

    // ------------------------------ FIELDS ------------------------------

    // end of enum constant constructions
    /**
     * additional instance field of every BreedI enum constant object
     */
    private final String colours;

    // -------------------------- PUBLIC INSTANCE  METHODS --------------------------
    /**
     * additional method of every BreedI enum constant object
     *
     * @return typical colours of the breed
     */
    public String getColours()
        {
        return colours;
        }

    // --------------------------- CONSTRUCTORS ---------------------------

    /**
     * constructor
     *
     * @param colours typical colours of this breed
     */
    BreedI( String colours )
        {
        this.colours = colours;
        }

    // --------------------------- main() method ---------------------------

    /**
     * Test harness
     *
     * @param args not used
     */
    @SuppressWarnings( { "UnusedParameters" } )
    public static void main( String[] args )
        {
        Breed myDog = Breed.DALMATIAN;
        // since the DALMATIAN inner class of Breed is anonymous,
        // we have no way of getting at the getSpotCount method.
        // This won't work:
        // System.out.println( myDog.getSpotCount() );
        }
    }