sdr 0.7

net.cscott.sdr.calls
Class FormationMatch

java.lang.Object
  extended by net.cscott.sdr.calls.FormationMatch

public class FormationMatch
extends Object

A successful attempt to match one or more instances of a given formation against the current setup yields a FormationMatch object. The FormationMatch contains a list of TaggedFormation; for example, matching a diamond against a twin diamond setup will result in two TaggedFormations, one for each diamond.


Field Summary
 Map<Dancer,TaggedFormation> matches
          The matches field is a map from phantom dancers in the meta formation to real dancers in a tagged subformation.
 Formation meta
          The meta formation contains one dancer for each matched sub-formation in the setup.
 Set<Dancer> unmatched
          Be explicit about unmatched dancers, just in case real matched dancers also map to FormationListFast.SINGLE_DANCER.
 
Constructor Summary
FormationMatch(Formation meta, Map<Dancer,TaggedFormation> matches, Set<Dancer> unmatched)
           
 
Method Summary
 FormationMatch map(Map<Dancer,Dancer> m)
          Remap the meta dancers in the given FormationMatch, returning a new FormationMatch.
 String toString()
          Pretty-print a FormationMatch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

meta

public final Formation meta
The meta formation contains one dancer for each matched sub-formation in the setup. Unmatched dancers (if allowed by the match) result in phantom dancers in the meta formation mapped to the FormationListFast.SINGLE_DANCER sub-formation.


matches

public final Map<Dancer,TaggedFormation> matches
The matches field is a map from phantom dancers in the meta formation to real dancers in a tagged subformation. The meta formation says how these subformations could be rotated, shifted, and recombined into the original setup.


unmatched

public final Set<Dancer> unmatched
Be explicit about unmatched dancers, just in case real matched dancers also map to FormationListFast.SINGLE_DANCER. This is a set of *phantom* dancers in the meta formation, which correspond (via SINGLE DANCER subformations) to unmatched real dancers.

Constructor Detail

FormationMatch

public FormationMatch(Formation meta,
                      Map<Dancer,TaggedFormation> matches,
                      Set<Dancer> unmatched)
Method Detail

map

public FormationMatch map(Map<Dancer,Dancer> m)
Remap the meta dancers in the given FormationMatch, returning a new FormationMatch.


toString

public String toString()
Pretty-print a FormationMatch.

Overrides:
toString in class Object

sdr 0.7

Copyright © 2006-2009 C. Scott Ananian