net.pacbell.jfai.toh.domain
Class Base

java.lang.Object
  extended by net.pacbell.jfai.toh.domain.Base

public class Base
extends Object

The base has the pins to stack the disks. For now, the base has three pins called left, middle, and right.


Constructor Summary
Base()
          Default constructor.
 
Method Summary
 List<Pin> getPins()
          Gets the pins.
 Pin pinNamed(String name)
          Answers the pin with the given name.
 Pin storagePin(Pin somePin, Pin anotherPin)
          Answers a pin that is different from each of the given pins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base

public Base()
Default constructor.

Method Detail

getPins

public List<Pin> getPins()
Gets the pins.

Returns:
All pins sorted from left to right.

pinNamed

public Pin pinNamed(String name)
Answers the pin with the given name.

Parameters:
name - Name of pin
Returns:
The pin with the given name or null if no pin can be found.

storagePin

public Pin storagePin(Pin somePin,
                      Pin anotherPin)
Answers a pin that is different from each of the given pins.

Parameters:
somePin - Name of first pin
anotherPin - Name of second pin
Returns:
Answers a pin that is none of the given pins.