|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oo.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 HasHLT
toString
in class java.lang.Object
public boolean headRed()
HasHLT
headRed
in interface HasHLT
public boolean leftBlue()
HasHLT
leftBlue
in interface HasHLT
public boolean topGreen()
HasHLT
topGreen
in interface HasHLT
public abstract Orientation roll()
PRYable
roll
in interface PRYable
public abstract Orientation pitch()
PRYable
pitch
in interface PRYable
public abstract Orientation yaw()
PRYable
yaw
in interface PRYable
public 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 |