Class Table

java.lang.Object
jadex.bdi.blocksworld.Block
jadex.bdi.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.
  • Field Details

    • name

      protected String name
      The name of the table.
    • blocks

      protected List blocks
      The blocks located on top of the table.
  • Constructor Details

    • Table

      public Table()
      Create a new table.
    • Table

      public Table(String name, Color color)
      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.
      Overrides:
      isClear in class Block
    • toString

      public String toString()
      Create a string representation of this block.
      Overrides:
      toString in class 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.
      Overrides:
      addBlock in class Block
    • removeBlock

      protected void removeBlock(Block block)
      Remove a block from this block.
      Overrides:
      removeBlock in class Block