model
Class TuringMap

java.lang.Object
  extended by model.TuringMap

public class TuringMap
extends java.lang.Object

Stores the implementation of a map

Author:
nadim

Constructor Summary
TuringMap(int[] map, int rows, int columns)
          Generates a map file
 
Method Summary
 boolean changeValueAtIndex(int index, int newValue)
          Changes the specified map position to the new value
 int[] getMap()
           
 int getNumColumns()
           
 int getNumRows()
           
 int getValueAtIndex(int index)
          Returns the value at the specified index
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TuringMap

public TuringMap(int[] map,
                 int rows,
                 int columns)
Generates a map file

Parameters:
map -
rows -
columns -
Method Detail

getMap

public int[] getMap()
Returns:
the map

getNumColumns

public int getNumColumns()
Returns:
the columns

getValueAtIndex

public int getValueAtIndex(int index)
Returns the value at the specified index

Returns:
an integer

changeValueAtIndex

public boolean changeValueAtIndex(int index,
                                  int newValue)
Changes the specified map position to the new value

Parameters:
index -
newValue -
Returns:
true if successful

getNumRows

public int getNumRows()
Returns:
the rows

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object