de.java_chess.javaChess.position
Interface Position

All Known Implementing Classes:
PositionImpl

public interface Position

This interface has to be implemented by any chess position.


Method Summary
 boolean equals(Position pos)
          Test if 2 positions are equal.
 int getLineIndex()
          Get the line index of this position.
 int getRowIndex()
          Get the row index of this position.
 int getSquareIndex()
          Get the square index of this position instance.
 void setSquareIndex(int index)
          The square index of this position instance.
 java.lang.String toSquareName()
          Get the name of this square.
 

Method Detail

getSquareIndex

public int getSquareIndex()
Get the square index of this position instance.
Returns:
The square index of this piece position (0-63).

setSquareIndex

public void setSquareIndex(int index)
The square index of this position instance.
Parameters:
index - The square index of this position (0-63).

getRowIndex

public int getRowIndex()
Get the row index of this position.
Returns:
The row index of this position (0-7).

getLineIndex

public int getLineIndex()
Get the line index of this position.
Returns:
The line index of this position (0-7).

toSquareName

public java.lang.String toSquareName()
Get the name of this square.
Returns:
The suare name of this position (i.e. a4).

equals

public boolean equals(Position pos)
Test if 2 positions are equal.
Parameters:
Another - position.
Returns:
true, if the positions are equal, false otherwise.