sealed abstract class CompassDir extends Product with Serializable
The class CompassDir
represents the cardinal compass directions in a grid-like coordinate system.
There are exactly four instances of this class: North
, East
, South
and West
, which are
also defined in this package.
All the CompassDir
objects are immutable.
This class and its instances have aliases in the top-level package o1, so they are accessible
to students simply via import o1._
.
- See also
- Alphabetic
- By Inheritance
- CompassDir
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- def clockwise: CompassDir
Returns the next of the four compass directions, moving clockwise from this one.
Returns the next of the four compass directions, moving clockwise from this one. For instance, calling this method on
North
returnsEast
. - def counterClockwise: CompassDir
Returns the next of the four compass directions, moving counterclockwise from this one.
Returns the next of the four compass directions, moving counterclockwise from this one. For instance, calling this method on
North
returnsWest
. - def productElementName(n: Int): String
- Definition Classes
- Product
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productIterator: Iterator[Any]
- Definition Classes
- Product
- def productPrefix: String
- Definition Classes
- Product
- def toString: String
Returns a textual description of this direction, which is the English name of the direction.
Returns a textual description of this direction, which is the English name of the direction.
- Definition Classes
- CompassDir → AnyRef → Any
- val xStep: Int
- val yStep: Int