sdr 0.7

net.cscott.sdr.calls
Enum StandardDancer

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

public enum StandardDancer
extends Enum<StandardDancer>
implements Dancer

An object representing one of the eight real dancers.

Tests:
Properties of DANCER_1 (a head boy):
js> const Tag = TaggedFormation.Tag;
js> d = StandardDancer.COUPLE_1_BOY;
COUPLE 1 BOY
js> d.coupleNumber()
1
js> d.isHead()
true
js> d.isSide()
false
js> d.isBoy()
true
js> d.isGirl()
false
js> d.ordinal()
0
js> d.primitiveTag()
DANCER_1
js> d.matchesTag(d.primitiveTag())
true
js> d.matchesTag(Tag.BOY)
true
js> d.matchesTag(Tag.GIRL)
false
js> d.matchesTag(Tag.HEAD)
true
js> d.matchesTag(Tag.SIDE)
false
js> [d.matchesTag(t) for each (t in
  >  [Tag.COUPLE_1, Tag.COUPLE_2, Tag.COUPLE_3, Tag.COUPLE_4])]
true,false,false,false
js> [d.matchesTag(t) for each (t in
  >  [Tag.DANCER_1, Tag.DANCER_2, Tag.DANCER_3, Tag.DANCER_4,
  >   Tag.DANCER_5, Tag.DANCER_6, Tag.DANCER_7, Tag.DANCER_8])]
true,false,false,false,false,false,false,false
js> d.matchesTag(Tag.NONE)
false
js> d.matchesTag(Tag.ALL)
true
Properties of DANCER_8 (a side girl):
js> const Tag = TaggedFormation.Tag;
js> d = StandardDancer.COUPLE_4_GIRL;
COUPLE 4 GIRL
js> d.coupleNumber()
4
js> d.isHead()
false
js> d.isSide()
true
js> d.isBoy()
false
js> d.isGirl()
true
js> d.ordinal()
7
js> d.primitiveTag()
DANCER_8
js> d.matchesTag(d.primitiveTag())
true
js> d.matchesTag(Tag.BOY)
false
js> d.matchesTag(Tag.GIRL)
true
js> d.matchesTag(Tag.HEAD)
false
js> d.matchesTag(Tag.SIDE)
true
js> [d.matchesTag(t) for each (t in
  >  [Tag.COUPLE_1, Tag.COUPLE_2, Tag.COUPLE_3, Tag.COUPLE_4])]
false,false,false,true
js> [d.matchesTag(t) for each (t in
  >  [Tag.DANCER_1, Tag.DANCER_2, Tag.DANCER_3, Tag.DANCER_4,
  >   Tag.DANCER_5, Tag.DANCER_6, Tag.DANCER_7, Tag.DANCER_8])]
false,false,false,false,false,false,false,true
js> d.matchesTag(Tag.NONE)
false
js> d.matchesTag(Tag.ALL)
true

Enum Constant Summary
COUPLE_1_BOY
           
COUPLE_1_GIRL
           
COUPLE_2_BOY
           
COUPLE_2_GIRL
           
COUPLE_3_BOY
           
COUPLE_3_GIRL
           
COUPLE_4_BOY
           
COUPLE_4_GIRL
           
 
Method Summary
 int coupleNumber()
          Returns a couple number, from 1-4.
 boolean isBoy()
           
 boolean isGirl()
           
 boolean isHead()
           
 boolean isSide()
           
 boolean matchesTag(TaggedFormation.Tag tag)
          Certain dancer TaggedFormation.Tags are inherent to a dancer, for example 'DANCER_1', 'COUPLE_2', 'BOY' etc.
 TaggedFormation.Tag primitiveTag()
          Returns the most-specific primitive tag for the given dancer, or 'null' if the dancer is a phantom.
 String toString()
           
static StandardDancer valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StandardDancer[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

COUPLE_1_BOY

public static final StandardDancer COUPLE_1_BOY

COUPLE_1_GIRL

public static final StandardDancer COUPLE_1_GIRL

COUPLE_2_BOY

public static final StandardDancer COUPLE_2_BOY

COUPLE_2_GIRL

public static final StandardDancer COUPLE_2_GIRL

COUPLE_3_BOY

public static final StandardDancer COUPLE_3_BOY

COUPLE_3_GIRL

public static final StandardDancer COUPLE_3_GIRL

COUPLE_4_BOY

public static final StandardDancer COUPLE_4_BOY

COUPLE_4_GIRL

public static final StandardDancer COUPLE_4_GIRL
Method Detail

values

public static StandardDancer[] 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 (StandardDancer c : StandardDancer.values())
    System.out.println(c);

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

valueOf

public static StandardDancer 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

coupleNumber

public int coupleNumber()
Returns a couple number, from 1-4.


isHead

public boolean isHead()
Specified by:
isHead in interface Dancer

isSide

public boolean isSide()
Specified by:
isSide in interface Dancer

isBoy

public boolean isBoy()
Specified by:
isBoy in interface Dancer

isGirl

public boolean isGirl()
Specified by:
isGirl in interface Dancer

matchesTag

public boolean matchesTag(TaggedFormation.Tag tag)
Description copied from interface: Dancer
Certain dancer TaggedFormation.Tags are inherent to a dancer, for example 'DANCER_1', 'COUPLE_2', 'BOY' etc. This method identifies if one of these tags is appropriate for the current Dancer.

Specified by:
matchesTag in interface Dancer

primitiveTag

public TaggedFormation.Tag primitiveTag()
Description copied from interface: Dancer
Returns the most-specific primitive tag for the given dancer, or 'null' if the dancer is a phantom.

Specified by:
primitiveTag in interface Dancer

toString

public String toString()
Overrides:
toString in class Enum<StandardDancer>

sdr 0.7

Copyright © 2006-2009 C. Scott Ananian