sdr 0.21

net.cscott.sdr.calls.ast
Class Prim

java.lang.Object
  extended by net.cscott.sdr.calls.ast.AstNode
      extended by net.cscott.sdr.calls.ast.SeqCall
          extended by net.cscott.sdr.calls.ast.Prim

public class Prim
extends SeqCall

A Prim represents a primitive action: a certain distance travelled forward and to the side, while rotating a certain amount, performed in a certain number of beats. PRIM is a leaf node in a our AST.

Version:
$Id: Prim.java,v 1.12 2007-03-07 19:56:21 cananian Exp $
Author:
C. Scott Ananian

Nested Class Summary
static class Prim.Direction
          The Prim.Direction enumeration tells whether the movement is relative to the center of the formation.
 
Field Summary
 Prim.Direction dirRot
          Is the movement direction relative to the center of the formation?
 Prim.Direction dirX
          Is the movement direction relative to the center of the formation?
 Prim.Direction dirY
          Is the movement direction relative to the center of the formation?
 boolean forceArc
          The @{link #forceArc} parameter helps distinguish between (say) "pass thru and quarter in" and "split counter rotate 1/4".
 boolean passRight
          This parameter indicates whether this motion involves a right shoulder pass (as most motions do, including "cross" calls where the crossers start far apart) or else a left shoulder pass ("cross" calls which start with adjacent crossers).
 ExactRotation rot
          Amount of rotation.
static Prim STAND_STILL
           
 Fraction time
          The number of beats which this motion should take.
 Fraction x
          Amount of movement in the 'x' direction (dancer's right/left).
 Fraction y
          Amount of movement in the 'y' direction (dancer forward and back).
 
Fields inherited from class net.cscott.sdr.calls.ast.AstNode
type
 
Constructor Summary
Prim(Prim.Direction dirX, Fraction x, Prim.Direction dirY, Fraction y, Prim.Direction dirRot, ExactRotation rot, Fraction time, boolean passRight, boolean forceArc)
           
 
Method Summary
<T> SeqCall
accept(TransformVisitor<T> v, T t)
           
<RESULT,CLOSURE>
RESULT
accept(ValueVisitor<RESULT,CLOSURE> v, CLOSURE cl)
           
 String argsToString()
           
 Prim build(Prim.Direction dirX, Fraction x, Prim.Direction dirY, Fraction y, Prim.Direction dirRot, ExactRotation rot, Fraction time, boolean passRight, boolean forceArc)
          Factory: creates new Prim only if it would differ from this.
 boolean equals(Object o)
           
 int hashCode()
           
 Prim scaleTime(Fraction f)
          Create a new Prim, identical to this one except that the time is scaled by the given fraction.
 
Methods inherited from class net.cscott.sdr.calls.ast.AstNode
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public final Fraction x
Amount of movement in the 'x' direction (dancer's right/left).


y

public final Fraction y
Amount of movement in the 'y' direction (dancer forward and back).


rot

public final ExactRotation rot
Amount of rotation.


dirX

public final Prim.Direction dirX
Is the movement direction relative to the center of the formation?


dirY

public final Prim.Direction dirY
Is the movement direction relative to the center of the formation?


dirRot

public final Prim.Direction dirRot
Is the movement direction relative to the center of the formation?


time

public final Fraction time
The number of beats which this motion should take.


passRight

public final boolean passRight
This parameter indicates whether this motion involves a right shoulder pass (as most motions do, including "cross" calls where the crossers start far apart) or else a left shoulder pass ("cross" calls which start with adjacent crossers).


forceArc

public final boolean forceArc
The @{link #forceArc} parameter helps distinguish between (say) "pass thru and quarter in" and "split counter rotate 1/4". Both of these involve traveling forward and turning, but the latter is an arcing motion (hence forceArc would be true) while the former is a straight line path (hence forceArc would be false).


STAND_STILL

public static final Prim STAND_STILL
Constructor Detail

Prim

public Prim(Prim.Direction dirX,
            Fraction x,
            Prim.Direction dirY,
            Fraction y,
            Prim.Direction dirRot,
            ExactRotation rot,
            Fraction time,
            boolean passRight,
            boolean forceArc)
Method Detail

accept

public <T> SeqCall accept(TransformVisitor<T> v,
                          T t)
Specified by:
accept in class SeqCall

accept

public <RESULT,CLOSURE> RESULT accept(ValueVisitor<RESULT,CLOSURE> v,
                                      CLOSURE cl)
Specified by:
accept in class AstNode

argsToString

public String argsToString()
Overrides:
argsToString in class AstNode

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

scaleTime

public Prim scaleTime(Fraction f)
Create a new Prim, identical to this one except that the time is scaled by the given fraction.


build

public Prim build(Prim.Direction dirX,
                  Fraction x,
                  Prim.Direction dirY,
                  Fraction y,
                  Prim.Direction dirRot,
                  ExactRotation rot,
                  Fraction time,
                  boolean passRight,
                  boolean forceArc)
Factory: creates new Prim only if it would differ from this.


sdr 0.21

Copyright (c) 2006 C. Scott Ananian