chessThreaded
Class ChessPiece

java.lang.Object
  |
  +--chessThreaded.ChessPiece

public class ChessPiece
extends java.lang.Object


Constructor Summary
ChessPiece()
          Creates a new instance of ChessPiece
ChessPiece(char col, java.lang.String pc)
          Creates a new instance of ChessPiece if any problems, make it empty
 
Method Summary
 boolean empty()
          report whether a piece is really an empty space
 boolean equals(java.lang.Object obj)
          determine if two chess pieces are equal valued
 char getColor()
           
 java.lang.String getPiece()
           
 int getValue()
          report an estimated value of a piece - very rough - never beat Kasparov with this
static void main(java.lang.String[] args)
          Used for testing pieces class - kinda sparse test right now
 boolean setColor(char col)
          change value for a pieces color - indicate failure if bad value passed
 boolean setPiece(java.lang.String pc)
          change value for a pieces type - indicate failure if bad value passed
 java.lang.String toString()
          make ready for presentation an empty piece is shown as blank
static boolean validColor(char col)
          static method to determine if a potential piece color is a valid piece color
static boolean validPieceType(java.lang.String pc)
          static method to determine if a potential piece type is a valid piece type
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChessPiece

public ChessPiece()
Creates a new instance of ChessPiece


ChessPiece

public ChessPiece(char col,
                  java.lang.String pc)
Creates a new instance of ChessPiece if any problems, make it empty

Method Detail

equals

public boolean equals(java.lang.Object obj)
determine if two chess pieces are equal valued

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
make ready for presentation an empty piece is shown as blank

Overrides:
toString in class java.lang.Object

getColor

public char getColor()

getPiece

public java.lang.String getPiece()

getValue

public int getValue()
report an estimated value of a piece - very rough - never beat Kasparov with this


empty

public boolean empty()
report whether a piece is really an empty space


validPieceType

public static boolean validPieceType(java.lang.String pc)
static method to determine if a potential piece type is a valid piece type


validColor

public static boolean validColor(char col)
static method to determine if a potential piece color is a valid piece color


setColor

public boolean setColor(char col)
change value for a pieces color - indicate failure if bad value passed


setPiece

public boolean setPiece(java.lang.String pc)
change value for a pieces type - indicate failure if bad value passed


main

public static void main(java.lang.String[] args)
Used for testing pieces class - kinda sparse test right now

Parameters:
args - the command line arguments