|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.cscott.sdr.calls.Formation net.cscott.sdr.calls.TaggedFormation
public class TaggedFormation
A TaggedFormation
is a set of dancers and positions for them.
Certain dancers in the formation can be selected.
In addition, all dancers can be tagged with modifiers
such as 'BEAU', 'BELLE', 'LEADER', 'TRAILER', etc.
js> FormationList = FormationList.js(this); undefined; js> f = FormationList.STATIC_SQUARE ; f.getClass() class net.cscott.sdr.calls.NamedTaggedFormation js> [ f.location(d) for each (d in Iterator(f.tagged(TaggedFormation.Tag.BEAU)))] 1,3,s,-3,1,e,3,-1,w,-1,-3,n
Nested Class Summary | |
---|---|
static class |
TaggedFormation.Tag
Dancer descriptions based on position in the Formation . |
Field Summary |
---|
Fields inherited from class net.cscott.sdr.calls.Formation |
---|
dancerNames, FOUR_SQUARE, location, selected, SQUARED_SET |
Constructor Summary | |
---|---|
|
TaggedFormation(Formation f,
MultiMap<Dancer,TaggedFormation.Tag> tags)
|
protected |
TaggedFormation(Map<Dancer,Position> location,
Set<Dancer> selected,
MultiMap<Dancer,TaggedFormation.Tag> tags)
|
protected |
TaggedFormation(TaggedFormation tf,
Map<Dancer,Dancer> map)
|
Method Summary | |
---|---|
TaggedFormation |
addTags(MultiMap<Dancer,TaggedFormation.Tag> newTags)
Add additional tags to the given formation. |
static TaggedFormation |
coerce(Formation f)
|
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isTagged(Dancer d,
Set<TaggedFormation.Tag> tags)
Return true if the dancer is tagged by any tag in the given set of tags |
boolean |
isTagged(Dancer d,
TaggedFormation.Tag tag)
Returns true if the dancer is tagged by the given tag. |
TaggedFormation |
map(Dancer... dancers)
Replace the dancers in this formation with the given dancers, specified in the "sorted dancers" order (left-to-right, top-to-bottom). |
TaggedFormation |
map(Map<Dancer,Dancer> map)
|
TaggedFormation |
mapStd(StandardDancer... dancers)
Special case of Formation.map(Dancer...) which allows you to specify
half the dancers, and fills in the rest with their opposites to
result in a symmetric formation. |
TaggedFormation |
move(Dancer d,
Position p)
Return a formation like this one, except that the given dancer is moved to the specified position. |
TaggedFormation |
select(Collection<Dancer> d)
Build a new formation with only the given dancers selected. |
Set<Dancer> |
tagged(Set<TaggedFormation.Tag> tags)
Return the set of dancers tagged by any of the given set of tags. |
Set<Dancer> |
tagged(TaggedFormation.Tag tag)
Return the set of dancers tagged with the given tag. |
Set<TaggedFormation.Tag> |
tags(Dancer d)
Return the non-primitive tags attached to this dancer. |
String |
toString()
|
Methods inherited from class net.cscott.sdr.calls.Formation |
---|
bounds, bounds, dancerComparator, dancers, isCentered, isSelected, location, mirror, onlySelected, recenter, rotate, select, selectedDancers, sortedDancers, toStringDiagram, toStringDiagram, toStringDiagram, toStringDiagramWithDetails, toStringDiagramWithDetails, toStringDiagramWithDetails |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected TaggedFormation(Map<Dancer,Position> location, Set<Dancer> selected, MultiMap<Dancer,TaggedFormation.Tag> tags)
protected TaggedFormation(TaggedFormation tf, Map<Dancer,Dancer> map)
public TaggedFormation(Formation f, MultiMap<Dancer,TaggedFormation.Tag> tags)
Method Detail |
---|
public boolean isTagged(Dancer d, TaggedFormation.Tag tag)
public boolean isTagged(Dancer d, Set<TaggedFormation.Tag> tags)
public Set<Dancer> tagged(TaggedFormation.Tag tag)
public Set<Dancer> tagged(Set<TaggedFormation.Tag> tags)
public Set<TaggedFormation.Tag> tags(Dancer d)
TaggedFormation
s, not to test whether a given dancer has
a particular tag. Use
isTagged(Dancer, net.cscott.sdr.calls.TaggedFormation.Tag)
if
you want to check whether a dancer has a particular tag.
public TaggedFormation select(Collection<Dancer> d)
Formation
select
in class Formation
public TaggedFormation move(Dancer d, Position p)
Formation
move
in class Formation
public TaggedFormation addTags(MultiMap<Dancer,TaggedFormation.Tag> newTags)
public boolean equals(Object o)
equals
in class Formation
public int hashCode()
hashCode
in class Formation
public String toString()
toString
in class Formation
public TaggedFormation map(Map<Dancer,Dancer> map)
map
in class Formation
public TaggedFormation map(Dancer... dancers)
map
in class Formation
js> FormationList = FormationList.js(this); undefined; js> const SD = StandardDancer; const l = net.cscott.sdr.util.Tools.l; js> f = FormationList.TRADE_BY; f.toStringDiagram(); ^ ^ v v ^ ^ v v js> // infinitest doesn't like overloaded methods in Rhino... js> f.map(l(SD.COUPLE_1_BOY, SD.COUPLE_1_GIRL, > SD.COUPLE_2_GIRL, SD.COUPLE_2_BOY, > SD.COUPLE_4_BOY, SD.COUPLE_4_GIRL, > SD.COUPLE_3_GIRL, SD.COUPLE_3_BOY) > .toArray(java.lang.reflect.Array.newInstance(Dancer,0)) > ).toStringDiagram(); 1B^ 1G^ 2Gv 2Bv 4B^ 4G^ 3Gv 3Bv
public TaggedFormation mapStd(StandardDancer... dancers)
Formation.map(Dancer...)
which allows you to specify
half the dancers, and fills in the rest with their opposites to
result in a symmetric formation.
mapStd
in class Formation
js> FormationList = FormationList.js(this); undefined; js> const SD = StandardDancer; js> f = FormationList.TRADE_BY; undefined; js> f.mapStd([SD.COUPLE_1_BOY, SD.COUPLE_1_GIRL, > SD.COUPLE_2_GIRL, SD.COUPLE_2_BOY]).toStringDiagram(); 1B^ 1G^ 2Gv 2Bv 4B^ 4G^ 3Gv 3Bv
public static TaggedFormation coerce(Formation f)
|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |