Package jadex.bdi.blocksworld
Class Table
java.lang.Object
jadex.bdi.blocksworld.Block
jadex.bdi.blocksworld.Table
A table in the blocks-world.
In contrast to a block, a table may have multiple blocks on top.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add a block to this block.void
clear()
clear all blocks from the table.boolean
configurationEquals
(Table table) Check if two configurations are equal.Block[]
Get all blocks on the table.Block[][]
Get the stacks on the table.boolean
isClear()
The table is always clear.protected void
removeBlock
(Block block) Remove a block from this block.toString()
Create a string representation of this block.
-
Field Details
-
name
The name of the table. -
blocks
The blocks located on top of the table.
-
-
Constructor Details
-
Table
public Table()Create a new table. -
Table
Create a new table.- Parameters:
name
- The name of the table.color
- The color of the table.
-
-
Method Details
-
isClear
public boolean isClear()The table is always clear. -
toString
Create a string representation of this block. -
getAllBlocks
Get all blocks on the table. Also returns blocks which are located on other blocks on the table. -
getStacks
Get the stacks on the table. -
clear
public void clear()clear all blocks from the table. -
configurationEquals
Check if two configurations are equal. -
addBlock
Add a block to this block. -
removeBlock
Remove a block from this block.- Overrides:
removeBlock
in classBlock
-