All Implemented Interfaces:
ICompositeElement, IContainer, IElement, Serializable

public final class TableCell extends TableElement
This class defines a single cell from a table. For internal use only. The TableBuilder class may be used to create a table container structure.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • TableCell

      public TableCell(Serializable objValue)
      Constructs the cell without a style and with a colspan of one.
      Parameters:
      objValue - The value for the cell.
    • TableCell

      public TableCell(Serializable objValue, int colspan)
      Constructs a cell with a value and colspan.
      Parameters:
      objValue - The value of the cell.
      colspan - The colspan of the cell.
    • TableCell

      protected TableCell(TableCell other)
    • TableCell

      public TableCell(Serializable objValue, int colspan, String style)
      Constructs a cell with a value, colspan and style.
      Parameters:
      objValue - The value of the cell.
      colspan - The colspan of the cell.
      style - The style of the cell.
  • Method Details

    • duplicate

      public Element duplicate()
      Description copied from class: Container
      This method duplicates the container element.
      Specified by:
      duplicate in interface IElement
      Overrides:
      duplicate in class TableElement
      Returns:
      A clone of this element.
    • getColspan

      public int getColspan()
      This method returns the colspan of the cell (usually 1).
      Returns:
      the colspan of the cell (usually 1).
    • getValue

      public Object getValue()
      This method returns the value of the cell.
      Returns:
      the value of the cell.
    • getAlignment

      public AlignType getAlignment()
      This method returns the alignment of the cell.
      Returns:
      the alignment of the cell.
    • setAlignment

      public TableCell setAlignment(AlignType alignType)
      This method may be used to specify the alignment of the cell.
      Parameters:
      alignType - The alignment of the cell.
      Returns:
      reference to this cell to allow method chaining.
    • accept

      public IVisitor accept(IVisitor visitor)
      Description copied from class: Element
      This method will invoke the visitor for this runtime element.
      Specified by:
      accept in interface ICompositeElement
      Specified by:
      accept in interface IElement
      Overrides:
      accept in class TableElement
      Parameters:
      visitor - The visitor that should be invoked.
      Returns:
      The visitor passed to this method.
    • equals

      public boolean equals(Object other)
      Description copied from class: Container
      Compare this container to another (not its elements, @see CompositeElement.equalsContent(com.aquima.interactions.composer.ICompositeElement) to compare its elements).
      Overrides:
      equals in class Container
      Parameters:
      other - The object this instance should be compared to.
      Returns:
      boolean indicating if the object is considered equal to this instance.
    • equalsContent

      public boolean equalsContent(ICompositeElement other)
      This methods checks if this table cell equals the content of another table cell. The content will be checked recursive, for example if a table cell contains a container which contains a sub container which contains a field with a different value false will be returned. If other is no instance of TableCell false is returned.
      Specified by:
      equalsContent in interface ICompositeElement
      Overrides:
      equalsContent in class CompositeElement
      Parameters:
      other - Table to compare to
      Returns:
      boolean if content of this table equals the content of another table.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Container