|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoo.Mattress1
public class Mattress1
A mattress and its orientations; the mattress's state (its orientation) is implemented with three booleans.
| To, after a ... | ||||
|---|---|---|---|---|
| From | pitch | roll | yaw | |
| FLB | HLT | FRT | HRB | |
| FRT | HRB | FLB | HLT | |
| HLT | FLB | HRB | FRT | |
| HRB | FRT | HLT | FLB | |
The FLB, FRT, etc. codes in the table above are interpreted as follows:
| Code | Meaning |
|---|---|
| B | Bottom is green |
| F | Foot is red |
| H | Head is red |
| L | Left is blue |
| R | Right is blue |
| T | Top is green |
| Constructor Summary | |
|---|---|
Mattress1()
Constructs a mattress with red-end at top, blue-end at left, and green-surface at top. |
|
| Method Summary | |
|---|---|
boolean |
headRed()
True iff the red end is at the top. |
boolean |
leftBlue()
True iff the blue side is at the left. |
PRYable |
pitch()
Pitches the thing a half-turn (180 degrees). |
PRYable |
roll()
Rolls the thing a half-turn (180 degrees). |
boolean |
topGreen()
True iff the green surface is on the top. |
java.lang.String |
toString()
A string representing the orientation, matching [HF][LR][TB]. The string contains H if headRed() and F otherwise; L if leftBlue() and R otherwise; and T if topGreen() and B otherwise. |
PRYable |
yaw()
Yaws the thing a half-turn (180 degrees). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Mattress1()
| Method Detail |
|---|
public java.lang.String toString()
HasHLT
toString in interface HasHLTtoString in class java.lang.Objectpublic boolean headRed()
HasHLT
headRed in interface HasHLTpublic boolean leftBlue()
HasHLT
leftBlue in interface HasHLTpublic boolean topGreen()
HasHLT
topGreen in interface HasHLTpublic PRYable pitch()
PRYable
pitch in interface PRYablepublic PRYable roll()
PRYable
roll in interface PRYablepublic PRYable yaw()
PRYable
yaw in interface PRYable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||