|
sdr 0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.cscott.sdr.calls.ast.AstNode
net.cscott.sdr.calls.ast.SeqCall
net.cscott.sdr.calls.ast.Prim
public class Prim
A Prim represents a primitive action: a certain distance traveled
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.
| Nested Class Summary | |
|---|---|
static class |
Prim.Direction
The Prim.Direction enumeration tells whether the movement
is relative to the center of the formation. |
static class |
Prim.Flag
The Prim.Flag enumeration represents various properties of the
movement described by this Prim. |
| 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? |
Set<Prim.Flag> |
flags
Flags refining this motion. |
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 'sashay' direction (dancer's right/left). |
Fraction |
y
Amount of movement in the 'walking' 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,
Prim.Flag... flags)
|
|
| Method Summary | ||
|---|---|---|
|
accept(TransformVisitor<T> v,
T t)
Visitor pattern implementation for transformations. |
|
|
accept(ValueVisitor<RESULT,CLOSURE> v,
CLOSURE cl)
Visitor pattern implementation for computations. |
|
String |
argsToString()
|
|
Prim |
build(Prim.Direction dirX,
Fraction x,
Prim.Direction dirY,
Fraction y,
Prim.Direction dirRot,
ExactRotation rot,
Fraction time,
Prim.Flag... flags)
Factory: creates new Prim only if it would differ from this. |
|
boolean |
equals(Object o)
|
|
int |
hashCode()
|
|
boolean |
isIndeterminate()
True if the result of SeqCall.parts() can not be used for
fractionalization. |
|
Expr |
parts()
How many 'parts' are represented by this SeqCall. |
|
Prim |
scaleTime(Fraction f)
Create a new Prim, identical to this one except that the time is scaled by the given fraction. |
|
static Prim |
valueOf(String s)
|
|
| 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 |
|---|
public final Fraction x
public final Fraction y
public final ExactRotation rot
public final Prim.Direction dirX
public final Prim.Direction dirY
public final Prim.Direction dirRot
public final Fraction time
public final Set<Prim.Flag> flags
public static final Prim STAND_STILL
| Constructor Detail |
|---|
public Prim(Prim.Direction dirX,
Fraction x,
Prim.Direction dirY,
Fraction y,
Prim.Direction dirRot,
ExactRotation rot,
Fraction time,
Prim.Flag... flags)
| Method Detail |
|---|
public Expr parts()
SeqCallSeqCall. Should
be Expr.literal(Fraction.ONE) for all but Part.
parts in class SeqCallpublic boolean isIndeterminate()
SeqCallSeqCall.parts() can not be used for
fractionalization.
isIndeterminate in class SeqCall
public <T> SeqCall accept(TransformVisitor<T> v,
T t)
AstNodeAstNode accepts a TransformVisitor and a
value, and returns an instance of its own type (ie,
Seq.accept(tv, "A") returns a Seq).
The 't' parameter is a closure.
accept in class SeqCall
public <RESULT,CLOSURE> RESULT accept(ValueVisitor<RESULT,CLOSURE> v,
CLOSURE cl)
AstNodeAstNode accepts a ValueVisitor and a closure,
and returns an object of the appropriate result type.
accept in class AstNodepublic String argsToString()
argsToString in class AstNodepublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Prim scaleTime(Fraction f)
public Prim build(Prim.Direction dirX,
Fraction x,
Prim.Direction dirY,
Fraction y,
Prim.Direction dirRot,
ExactRotation rot,
Fraction time,
Prim.Flag... flags)
public static Prim valueOf(String s)
throws IllegalArgumentException
IllegalArgumentException
|
sdr 0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||