Packagecom.lookbackon.ds
Classpublic class BitBoard
InheritanceBitBoard Inheritance BitVector Inheritance Object
Implements IBitBoard
Subclasses AbstractChessVO

See also

http://blog.lookbackon.com/?p=371


Public Properties
 PropertyDefined By
 InheritedbitCount : int
[read-only] The total number of bits.
BitVector
 InheritedcellCount : int
[read-only] The total number of cells.
BitVector
  celled : int
[read-only]
BitBoard
  column : int
[read-only]
BitBoard
  isEmpty : Boolean
[read-only] whether or not bitboard is empty;
BitBoard
  row : int
[read-only]
BitBoard
Public Methods
 MethodDefined By
  
BitBoard(column:int, row:int)
BitBoard
  
BitBoard
  
clear():void
[override] Resets all bits to 0;
BitBoard
  
BitBoard
  
dump():String
Dump out a string representing the current object.
BitBoard
 Inherited
getBit(index:int):int
Gets a bit from a given index.
BitVector
  
getBitt(row:int, column:int):int
Gets a bit from a given row and column.
BitBoard
  
getCols(colIndex:int):Array
BitBoard
  
getRows(rowIndex:int):Array
BitBoard
  
BitBoard
  
BitBoard
 Inherited
resize(size:int):void
Resizes the bit-vector to an appropriate number of bits.
BitVector
  
BitBoard
  
notice:this function is suitable for which board column equals to row.
BitBoard
  
BitBoard
  
setAll():void
[override] Sets each bit to 1.
BitBoard
 Inherited
setBit(index:int, b:Boolean):void
Sets a bit at a given index.
BitVector
  
setBitt(row:int, column:int, b:Boolean):void
Sets a bit at a given row and column.
BitBoard
  
toString():String
[override] Prints out a string representing the current object.
BitBoard
  
BitBoard
Property Detail
celledproperty
celled:int  [read-only]


Implementation
    public function get celled():int
columnproperty 
column:int  [read-only]


Implementation
    public function get column():int
isEmptyproperty 
isEmpty:Boolean  [read-only]

whether or not bitboard is empty;


Implementation
    public function get isEmpty():Boolean
rowproperty 
row:int  [read-only]


Implementation
    public function get row():int
Constructor Detail
BitBoard()Constructor
public function BitBoard(column:int, row:int)

Parameters
column:int — the number column of bit board.
 
row:int — the number row of bit board.
Method Detail
and()method
public function and(value:BitBoard):BitBoard

Parameters

value:BitBoard

Returns
BitBoard
clear()method 
override public function clear():void

Resets all bits to 0;

clone()method 
public function clone():BitBoard

Returns
BitBoard
dump()method 
public function dump():String

Dump out a string representing the current object.

Returns
String — A "human-readable" string representing the current object.
getBitt()method 
public function getBitt(row:int, column:int):int

Gets a bit from a given row and column.

Parameters

row:int — the row number.
 
column:int — the column number.

Returns
int — the index bool value.
getCols()method 
public function getCols(colIndex:int):Array

Parameters

colIndex:int

Returns
Array
getRows()method 
public function getRows(rowIndex:int):Array

Parameters

rowIndex:int

Returns
Array
not()method 
public function not():BitBoard

Returns
BitBoard
or()method 
public function or(value:BitBoard):BitBoard

Parameters

value:BitBoard

Returns
BitBoard
reverse()method 
public function reverse():BitBoard

Returns
BitBoard — reversed rows with cols such as mirror rotatation 180 degree.
rotate45()method 
public function rotate45():BitBoard

notice:this function is suitable for which board column equals to row.

Returns
BitBoard — Fliped rows with cols such as clockwise rotatation 45 degree.
rotate90()method 
public function rotate90():BitBoard

Returns
BitBoard — Fliped rows with cols such as clockwise rotatation 90 degree.
setAll()method 
override public function setAll():void

Sets each bit to 1.

setBitt()method 
public function setBitt(row:int, column:int, b:Boolean):void

Sets a bit at a given row and column.

Parameters

row:int — the row number.
 
column:int — the column number.
 
b:Boolean — the index bool value.

toString()method 
override public function toString():String

Prints out a string representing the current object.

Returns
String — A string representing the current object.
xor()method 
public function xor(value:BitBoard):BitBoard

Parameters

value:BitBoard

Returns
BitBoard