Package jadex.bdi.examples.blocksworld
Class Table
- java.lang.Object
-
- jadex.bdi.examples.blocksworld.Block
-
- jadex.bdi.examples.blocksworld.Table
-
public class Table extends Block
A table in the blocks-world. In contrast to a block, a table may have multiple blocks on top.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addBlock(Block block)
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[]
getAllBlocks()
Get all blocks on the table.Block[][]
getStacks()
Get the stacks on the table.boolean
isClear()
The table is always clear.protected void
removeBlock(Block block)
Remove a block from this block.java.lang.String
toString()
Create a string representation of this block.-
Methods inherited from class jadex.bdi.examples.blocksworld.Block
addPropertyChangeListener, equals, getColor, getLower, getNumber, hashCode, removePropertyChangeListener, setLower, stackOn
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
Create a string representation of this block.
-
getAllBlocks
public Block[] getAllBlocks()
Get all blocks on the table. Also returns blocks which are located on other blocks on the table.
-
getStacks
public Block[][] getStacks()
Get the stacks on the table.
-
clear
public void clear()
clear all blocks from the table.
-
configurationEquals
public boolean configurationEquals(Table table)
Check if two configurations are equal.
-
addBlock
protected void addBlock(Block block)
Add a block to this block.
-
removeBlock
protected void removeBlock(Block block)
Remove a block from this block.- Overrides:
removeBlock
in classBlock
-
-