Class frog.Frog
- public class Frog
- extends Object
- implements frog.IFrog
An implementation of IFrog using external states encapsulated by the frog package.

_pos
- The current position of the frog
_state
- The current state of the frog

getColor
()
- Accessor method for the color of the frog
getHit
()
- The hits the frog
getPos
()
- Accessor method for the position of the frog
moveBy
(Point)
- Requests that the frog be translated the position by the given vector (Point)
setState
(AFrogState)
- Sets the state of the frog

_pos
private Point _pos = new Point(0,0)
- The current position of the frog.
_state
private AFrogState _state = LiveState.Singleton
- The current state of the frog.

getPos
public Point getPos()
- Accessor method for the position of the frog.
- Returns:
- The current position Point of the frog
getColor
public Color getColor()
- Accessor method for the color of the frog.
A live frog is green and a dead frog is red.
- Returns:
- The Color of the frog
moveBy
public Point moveBy(Point delta)
- Requests that the frog be translated the position by the given vector (Point).
Live frogs move by the given amount. Dead frogs do not move.
- Parameters:
- delta - The amount to move the frog by.
- Returns:
- The resultant position of the frog
getHit
public IFrog getHit()
- The hits the frog.
A live frog will die when it gets hit.
A dead frog stays dead when gets hit.
- Returns:
- The frog itself is returned.
setState
void setState(AFrogState s)
- Sets the state of the frog.
- Parameters:
- s - The new state of the frog.