PrintGame
Class Field

java.lang.Object
  extended byPrintGame.Field
Direct Known Subclasses:
LabyrinthField

public class Field
extends java.lang.Object

Implementation of a two dimensional field


Field Summary
protected  java.lang.Object[][] field_
           
 
Constructor Summary
Field(int rows, int cols)
          standard constructor
 
Method Summary
 int getNumCols()
          returns the number of allocated columns
 int getNumRows()
          returns the number of allocated rows
 java.lang.String toString()
          standard toString method for debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

field_

protected java.lang.Object[][] field_
Constructor Detail

Field

public Field(int rows,
             int cols)
      throws java.lang.IllegalArgumentException
standard constructor

Parameters:
rows - the number of rows of the field
cols - the number of columns of the field
Throws:
java.lang.IllegalArgumentException - thrown if either rows or cols is < 0
Method Detail

getNumRows

public int getNumRows()
returns the number of allocated rows

Returns:
the number of allocated rows

getNumCols

public int getNumCols()
returns the number of allocated columns

Returns:
the number of allocated columns

toString

public java.lang.String toString()
standard toString method for debugging

Returns:
info about the field in string-format