Holger's
Java API

com.antelmann.game.chess
Class BoardPosition

java.lang.Object
  extended by com.antelmann.game.GameBoardPosition
      extended by com.antelmann.game.chess.BoardPosition
All Implemented Interfaces:
Serializable, Cloneable

public class BoardPosition
extends GameBoardPosition

BoardPosition represents a position on a chess board. This class is also used by other game packages and therefore public.

Author:
Holger Antelmann
See Also:
Serialized Form

Constructor Summary
BoardPosition(char file, int rank)
           
BoardPosition(int pos)
           
 
Method Summary
protected static int calculateIntPos(char file, int rank)
           
 Object clone()
           
protected  char getColumn()
           
 char getFile()
           
 int getRank()
           
protected  int getRow()
           
 int getTileColor()
           
 BoardPosition relativePosition(int fileAddition, int rankAddition)
           
 String toString()
           
static boolean validPosition(char file, int rank)
           
static boolean validPosition(int pos)
           
 
Methods inherited from class com.antelmann.game.GameBoardPosition
asInteger, equals
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoardPosition

public BoardPosition(char file,
                     int rank)
              throws IllegalArgumentException
Throws:
IllegalArgumentException

BoardPosition

public BoardPosition(int pos)
              throws IllegalArgumentException
Throws:
IllegalArgumentException
Method Detail

getTileColor

public int getTileColor()

toString

public String toString()
Overrides:
toString in class GameBoardPosition

getFile

public char getFile()

getRank

public int getRank()

getColumn

protected char getColumn()

getRow

protected int getRow()

validPosition

public static boolean validPosition(char file,
                                    int rank)

validPosition

public static boolean validPosition(int pos)

relativePosition

public BoardPosition relativePosition(int fileAddition,
                                      int rankAddition)

calculateIntPos

protected static int calculateIntPos(char file,
                                     int rank)
                              throws IllegalArgumentException
Throws:
IllegalArgumentException

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads