de.java_chess.javaChess.notation
Class PlyNotationImpl

java.lang.Object
  |
  +--de.java_chess.javaChess.notation.PlyNotationImpl

public class PlyNotationImpl
extends java.lang.Object
implements PlyNotation

This class holds all the methods to render a ply as a string notation.


Constructor Summary
PlyNotationImpl(Ply ply, boolean capture, Piece piece)
          Create a new ply notation instance.
 
Method Summary
 Piece getPiece()
          Get the piece of this ply.
 java.lang.String getPieceTypeNotation(byte pieceType)
          Get the notation for a piece type.
 Ply getPly()
          Get the ply of this notation.
 boolean isCapture()
          Check if the piece captures another piece with this ply.
 void setCapture(boolean capture)
          Set the flag to indicate if another piece is captureed with this ply.
 void setPiece(Piece piece)
          Set the piece, that is moved with this ply.
 void setPly(Ply ply)
          Set the ply for this notation.
 java.lang.String toString()
          Render this notation as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlyNotationImpl

public PlyNotationImpl(Ply ply,
                       boolean capture,
                       Piece piece)
Create a new ply notation instance.
Parameters:
ply - The ply to render.
capture - Flag to indicate if it's a capture.
piece - The moved piece.
Method Detail

toString

public java.lang.String toString()
Render this notation as a string.
Specified by:
toString in interface PlyNotation
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this ply.

getPiece

public final Piece getPiece()
Get the piece of this ply.
Specified by:
getPiece in interface PlyNotation
Returns:
The piece, that is moved with this ply.

setPiece

public final void setPiece(Piece piece)
Set the piece, that is moved with this ply.
Specified by:
setPiece in interface PlyNotation
Parameters:
ply - The moved ply.

getPly

public final Ply getPly()
Get the ply of this notation.
Specified by:
getPly in interface PlyNotation
Returns:
The ply for this notation.

setPly

public final void setPly(Ply ply)
Set the ply for this notation.
Specified by:
setPly in interface PlyNotation
Parameters:
ply - The ply for this notation.

isCapture

public final boolean isCapture()
Check if the piece captures another piece with this ply.
Specified by:
isCapture in interface PlyNotation
Returns:
true, if another piece is captureed with this ply.

setCapture

public final void setCapture(boolean capture)
Set the flag to indicate if another piece is captureed with this ply.
Specified by:
setCapture in interface PlyNotation
Parameters:
capture - Flag to indicate, if this ply captures another piece.

getPieceTypeNotation

public final java.lang.String getPieceTypeNotation(byte pieceType)
Get the notation for a piece type.
Specified by:
getPieceTypeNotation in interface PlyNotation
Returns:
The notation for a piece type.