|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoo.Orientation
public abstract class Orientation
An orientation of a mattress.
There are four possible orientations
(HLT,
HRB,
FLB, and
FRT);
no others can be constructed.
This class ensures that the only orientations are the four physically-possible orientations. Each orientation is embodied by a singleton object of a subclass of Orientation.
| Field Summary | |
|---|---|
static Orientation |
FLB
The singleton FLB orientation. |
static Orientation |
FRT
The singleton FRT orientation. |
static Orientation |
HLT
The singleton HLT orientation. |
static Orientation |
HRB
The singleton HRB orientation. |
| Constructor Summary | |
|---|---|
protected |
Orientation(java.lang.String _toString)
Protected constructor for orientations. |
| Method Summary | |
|---|---|
Orientation |
FLB()
The FLB orientation (foot, left, bottom). |
Orientation |
FRT()
The FRT orientation (foot, right, top). |
boolean |
headRed()
True iff the red end is at the top. |
Orientation |
HLT()
The HLT orientation (head, left, top). |
Orientation |
HRB()
The HRB orientation (head, right, bottom). |
boolean |
leftBlue()
True iff the blue side is at the left. |
abstract Orientation |
pitch()
Pitches the thing a half-turn (180 degrees). |
abstract Orientation |
roll()
Rolls the thing a half-turn (180 degrees). |
boolean |
topGreen()
True iff the green surface is on the top. |
java.lang.String |
toString()
"HLT", "HRB", "FLB", or "FRT", whichever describes this orientation. |
abstract Orientation |
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 |
| Field Detail |
|---|
public static final Orientation HLT
public static final Orientation HRB
public static final Orientation FLB
public static final Orientation FRT
| Constructor Detail |
|---|
protected Orientation(java.lang.String _toString)
_toString - "HLT", "HRB", "FLB", or "FRT".| Method Detail |
|---|
public java.lang.String toString()
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 abstract Orientation roll()
PRYable
roll in interface PRYablepublic abstract Orientation pitch()
PRYable
pitch in interface PRYablepublic abstract Orientation yaw()
PRYable
yaw in interface PRYablepublic Orientation HLT()
public Orientation HRB()
public Orientation FLB()
public Orientation FRT()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||