GODPAPER | All Packages | All Classes | Index | Frames No Frames |
BitBoard

Package | com.lookbackon.ds
Class | public class BitBoard
Inheritance | BitBoard BitVector Object
Implements | IBitBoard
Subclasses | AbstractChessVO

See also

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

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | bitCount : int [read-only] The total number of bits. | BitVector
|  | cellCount : 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | BitBoard(column:int, row:int) | BitBoard
|  | and(value:BitBoard):BitBoard | BitBoard
|  | clear():void [override] Resets all bits to 0; | BitBoard
|  | clone():BitBoard | BitBoard
|  | dump():String Dump out a string representing the current object. | BitBoard
|  | 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
|  | not():BitBoard | BitBoard
|  | or(value:BitBoard):BitBoard | BitBoard
|  | resize(size:int):void Resizes the bit-vector to an appropriate number of bits. | BitVector
|  | reverse():BitBoard | BitBoard
|  | rotate45():BitBoard notice:this function is suitable for which board column equals to row. | BitBoard
|  | rotate90():BitBoard | BitBoard
|  | setAll():void [override] Sets each bit to 1. | BitBoard
|  | 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
|  | xor(value:BitBoard):BitBoard | BitBoard

Property Detail

celled | property

`celled:int` [read-only]

Implementation
`public function get celled():int`

column | property |

`column:int` [read-only]

Implementation
`public function get column():int`

isEmpty | property |

`isEmpty:Boolean` [read-only]

whether or not bitboard is empty;

Implementation
`public function get isEmpty():Boolean`

row | property |

`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`

Thu Jan 16 2014, 01:11 PM +08:00