ro.inf.p2.odd.alan
Class Tape

java.lang.Object
  extended by ro.inf.p2.odd.alan.Tape
Direct Known Subclasses:
TuringMachine

public class Tape
extends java.lang.Object

Class Tape A Endless Tape, on which the Touring Machine writes


Constructor Summary
Tape()
           
 
Method Summary
 java.lang.Character getCurrentValue()
          Get the value at the current position at the tape.
 void moveLeft()
          Move the tape left.
 void moveRight()
          move the tape right
 void moveStart()
          move the tape back to the initial position
 int offsetToLeftMostChar()
          Returns the offset between the left most character and the current character
 void setContent(java.lang.String value)
          Set the tapes content to @param value
 void setCurrentValue(java.lang.Character value)
          Set the value at the current position at the tape.
 java.lang.String toString()
          Reimplemented from Object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tape

public Tape()
Method Detail

setCurrentValue

public void setCurrentValue(java.lang.Character value)
Set the value at the current position at the tape.


getCurrentValue

public java.lang.Character getCurrentValue()
Get the value at the current position at the tape.


moveLeft

public void moveLeft()
Move the tape left.


moveRight

public void moveRight()
move the tape right


moveStart

public void moveStart()
move the tape back to the initial position


offsetToLeftMostChar

public int offsetToLeftMostChar()
Returns the offset between the left most character and the current character

Returns:
offset from the current character to the most left character

toString

public java.lang.String toString()
Reimplemented from Object. Convert the current tape to a string, so that the tape can be shown to the user at any state.

Overrides:
toString in class java.lang.Object

setContent

public void setContent(java.lang.String value)
Set the tapes content to @param value