chesspresso.position
Class AbstractMutablePosition

java.lang.Object
  |
  +--chesspresso.position.AbstractPosition
        |
        +--chesspresso.position.AbstractMutablePosition
All Implemented Interfaces:
ImmutablePosition, MutablePosition
Direct Known Subclasses:
AbstractMoveablePosition, LightWeightPosition

public abstract class AbstractMutablePosition
extends AbstractPosition
implements MutablePosition

Version:
$Revision: 1.1 $
Author:
Bernhard Seybold

Field Summary
protected  PositionChangeListener[] m_changeListeners
           
protected  PositionListener[] m_listeners
           
protected  boolean m_notifyListeners
           
protected  boolean m_notifyPositionChanged
           
 
Fields inherited from class chesspresso.position.AbstractPosition
HASH_ALL_MASK, HASH_TOPLAY_MASK, HASH_TOPLAY_MULT, s_hashCastleMod, s_hashEPMod, s_hashMod
 
Fields inherited from interface chesspresso.position.ImmutablePosition
ALL_CASTLES, BLACK_CASTLE, BLACK_LONG_CASTLE, BLACK_SHORT_CASTLE, NO_CASTLES, WHITE_CASTLE, WHITE_LONG_CASTLE, WHITE_SHORT_CASTLE
 
Constructor Summary
protected AbstractMutablePosition()
           
 
Method Summary
 void addPositionChangeListener(PositionChangeListener listener)
           
 void addPositionListener(PositionListener listener)
           
 void clear()
           
 void excludeCastles(int whichCastles)
           
protected  void fireCastlesChanged()
           
protected  void fireHalfMoveClockChanged()
           
protected  void fireMoveDone(short move)
           
protected  void fireMoveUndone()
           
protected  void firePlyNumberChanged()
           
 void firePositionChanged()
           
protected  void fireSqiEPChanged()
           
protected  void fireSquareChanged(int sqi)
           
protected  void fireToPlayChanged()
           
 int getColor(int sqi)
           
 int getPiece(int sqi)
           
 void incHalfMoveClock()
           
 void includeCastles(int whichCastles)
           
 void inverse()
           
 boolean isSquareEmpty(int sqi)
           
 void removePositionChangeListener(PositionChangeListener listener)
           
 void removePositionListener(PositionListener listener)
           
 void resetHalfMoveClock()
           
 void set(ImmutablePosition position)
           
 void setNotifyListeners(boolean notify)
           
 void setStart()
           
 void toggleToPlay()
           
 
Methods inherited from class chesspresso.position.AbstractPosition
equals, getFEN, getHashCode, getStartPositionHashCode, hashCode, isCastlePossible, isLegal, isSquarePossibleEPSquare, isStartPosition, isWhiteToPlay, toString, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface chesspresso.position.MutablePosition
setCastles, setHalfMoveClock, setPlyNumber, setSqiEP, setStone, setToPlay
 
Methods inherited from interface chesspresso.position.ImmutablePosition
getCastles, getFEN, getHalfMoveClock, getHashCode, getPlyNumber, getSqiEP, getStone, getToPlay, hashCode, isLegal, isStartPosition, validate
 

Field Detail

m_listeners

protected PositionListener[] m_listeners

m_changeListeners

protected PositionChangeListener[] m_changeListeners

m_notifyListeners

protected boolean m_notifyListeners

m_notifyPositionChanged

protected boolean m_notifyPositionChanged
Constructor Detail

AbstractMutablePosition

protected AbstractMutablePosition()
Method Detail

getPiece

public int getPiece(int sqi)

getColor

public int getColor(int sqi)

isSquareEmpty

public boolean isSquareEmpty(int sqi)

toggleToPlay

public void toggleToPlay()

clear

public void clear()
Specified by:
clear in interface MutablePosition

setStart

public void setStart()
Specified by:
setStart in interface MutablePosition

set

public void set(ImmutablePosition position)
Specified by:
set in interface MutablePosition

inverse

public final void inverse()

includeCastles

public final void includeCastles(int whichCastles)

excludeCastles

public final void excludeCastles(int whichCastles)

resetHalfMoveClock

public final void resetHalfMoveClock()

incHalfMoveClock

public final void incHalfMoveClock()

fireSquareChanged

protected void fireSquareChanged(int sqi)

fireToPlayChanged

protected void fireToPlayChanged()

fireSqiEPChanged

protected void fireSqiEPChanged()

fireCastlesChanged

protected void fireCastlesChanged()

firePlyNumberChanged

protected void firePlyNumberChanged()

fireHalfMoveClockChanged

protected void fireHalfMoveClockChanged()

fireMoveDone

protected void fireMoveDone(short move)

fireMoveUndone

protected void fireMoveUndone()

firePositionChanged

public void firePositionChanged()

addPositionListener

public final void addPositionListener(PositionListener listener)

removePositionListener

public final void removePositionListener(PositionListener listener)

setNotifyListeners

public final void setNotifyListeners(boolean notify)

addPositionChangeListener

public final void addPositionChangeListener(PositionChangeListener listener)

removePositionChangeListener

public final void removePositionChangeListener(PositionChangeListener listener)