|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoo.Flip
public abstract class Flip
A flip (a pitch, roll, yaw, or null flip having no effect) used by Mattress3's implementation.
Each of its four subclasses implements its
composeWith(Flip)
method identically,
by returning _other.composedWith(this).
This selects (at compile time)
the appropriate composedWith method
for composedWith's run-time argument:
Each subclass's four composedWith methods then simply returns the single possible result for the parameter type.
The result of composing non-NULL
flips A and B
follows a simple pattern
that can be verified
by examining OO Examples
Figure 2:
The two cases | A composed with B |
---|---|
A == B | NULL |
A != B | The other non-NULL flip |
The figure also shows that composition of flips is commutative.
Of course,
the NULL
flip when composed with any other flip C
is that same flip C
(including the case where C is itself NULL
).
Field Summary | |
---|---|
static FlipNULL |
NULL
A null flipthat does nothing to an orientation. |
static FlipPITCH |
PITCH
A pitch through a half turn (180°) |
static FlipROLL |
ROLL
A roll through a half turn (180°) |
static FlipYAW |
YAW
A yaw through a half turn (180°) |
Constructor Summary | |
---|---|
protected |
Flip()
Protected default constructor, can only be called by subclasses of Flip. |
Method Summary | |
---|---|
(package private) abstract Flip |
composedWith(FlipNULL _other)
Package-private method composing this flip with a null flip. |
(package private) abstract Flip |
composedWith(FlipPITCH _other)
Package-private method composing this flip with a FlipPITCH. |
(package private) abstract Flip |
composedWith(FlipROLL _other)
Package-private method composing this flip with a FlipROLL. |
(package private) abstract Flip |
composedWith(FlipYAW _other)
Package-private method composing this flip with a FlipYAW. |
abstract Flip |
composeWith(Flip _other)
Composes this flip with _other, resulting in a flip. |
abstract Orientation |
flip(Orientation _initial)
Applies this flip to an orientation, producing an orientation. |
abstract java.lang.String |
toString()
The flip's name ( null, pitch, roll, or yaw). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final FlipNULL NULL
null flipthat does nothing to an orientation.
public static final FlipPITCH PITCH
public static final FlipROLL ROLL
public static final FlipYAW YAW
Constructor Detail |
---|
protected Flip()
Method Detail |
---|
public abstract java.lang.String toString()
null,
pitch,
roll, or
yaw).
toString
in class java.lang.Object
abstract Flip composedWith(FlipNULL _other)
java.lang.NullPointerException
- If _other is null.abstract Flip composedWith(FlipPITCH _other)
java.lang.NullPointerException
- If _other is null.abstract Flip composedWith(FlipROLL _other)
java.lang.NullPointerException
- If _other is null.abstract Flip composedWith(FlipYAW _other)
java.lang.NullPointerException
- If _other is null.public abstract Flip composeWith(Flip _other)
java.lang.NullPointerException
- If _other is null.public abstract Orientation flip(Orientation _initial)
java.lang.NullPointerException
- If _initial is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |