sdr 0.7

net.cscott.sdr.calls
Enum Program

java.lang.Object
  extended by java.lang.Enum<Program>
      extended by net.cscott.sdr.calls.Program
All Implemented Interfaces:
Serializable, Comparable<Program>

public enum Program
extends Enum<Program>

Enumeration of square dance programs. Every call belongs to one or more square dance programs, which are usually arranged in a hierarchy such that each successive program contains all the calls from all previous programs.


Enum Constant Summary
A1
           
A2
           
BASIC
           
C1
           
C2
           
C3A
           
C3B
           
C4
           
MAINSTREAM
           
PLUS
           
 
Method Summary
 boolean includes(Program p)
          Implement an ordering on programs.
 String toTitleCase()
           
static Program valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Program[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BASIC

public static final Program BASIC

MAINSTREAM

public static final Program MAINSTREAM

PLUS

public static final Program PLUS

A1

public static final Program A1

A2

public static final Program A2

C1

public static final Program C1

C2

public static final Program C2

C3A

public static final Program C3A

C3B

public static final Program C3B

C4

public static final Program C4
Method Detail

values

public static Program[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Program c : Program.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Program valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

includes

public boolean includes(Program p)
Implement an ordering on programs. Right now this is the same as the ordinal numbering for the enumeration, but when we implement 'variants', then the variant lists should split off (so that C1V includes C1 and A2V, but C1 doesn't include A2V). Best way to implement this (again, eventually) is to have each class indicate what the class directly below it is, and recursively define inclusion.

Tests:
js> Program.C3A.includes(Program.C1)
true
js> Program.MAINSTREAM.includes(Program.A1)
false
js> [Program.BASIC.includes(p) for each (p in Program.values())]
true,false,false,false,false,false,false,false,false,false
js> [Program.C3B.includes(p) for each (p in Program.values())]
true,true,true,true,true,true,true,true,true,false

toTitleCase

public String toTitleCase()

sdr 0.7

Copyright © 2006-2009 C. Scott Ananian