Class TablePositionBase<TC extends TableColumnBase>

java.lang.Object
javafx.scene.control.TablePositionBase<TC>
Direct Known Subclasses:
TablePosition, TreeTablePosition

public abstract class TablePositionBase<TC extends TableColumnBase>
extends Object
This class is used to represent a single row/column/cell in a table. Concrete subclasses of this abstract class are used in the TableView and TreeTableView APIs to represent which rows/columns/cells are currently selected, focused, being edited, etc. Note that this class is immutable once it is created.

Because the TableView and TreeTableView controls can have different selection modes, the row and column properties in TablePositionBase can be 'disabled' to represent an entire row or column. This is done by setting the unrequired property to -1 or null.

Since:
JavaFX 8.0
See Also:
TablePosition, TreeTablePosition
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected TablePositionBase​(int row, TC tableColumn)
    Constructs a TablePositionBase instance to represent the given row/column position in the underlying table instance (which is not part of the abstract TablePositionBase class, but is part of concrete subclasses such as TablePosition and TreeTablePosition).
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(Object obj)
    Indicates whether some other object is "equal to" this one.
    abstract int getColumn()
    The column index that this TablePosition represents in the TableView.
    int getRow()
    The row that this TablePosition represents in the TableView.
    TC getTableColumn()
    The TableColumn that this TablePosition represents in the TableView.
    int hashCode()
    Returns a hash code for this TablePosition object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TablePositionBase

      protected TablePositionBase​(int row, TC tableColumn)
      Constructs a TablePositionBase instance to represent the given row/column position in the underlying table instance (which is not part of the abstract TablePositionBase class, but is part of concrete subclasses such as TablePosition and TreeTablePosition). In all cases, all fields inside TablePositionBase instances are referenced weakly so as to prevent memory leaks. This means that it is possible (but unlikely) that the get methods will return null.
      Parameters:
      row - The row that this TablePosition is representing.
      tableColumn - The TableColumn instance that this TablePosition represents.
  • Method Details

    • getRow

      public int getRow()
      The row that this TablePosition represents in the TableView.
      Returns:
      the row that this TablePosition represents in the TableView
    • getColumn

      public abstract int getColumn()
      The column index that this TablePosition represents in the TableView. It is -1 if the TableView or TableColumn instances are null.
      Returns:
      the column index that this TablePosition represents in the TableView
    • getTableColumn

      public TC getTableColumn()
      The TableColumn that this TablePosition represents in the TableView.
      Returns:
      the TableColumn that this TablePosition represents in the TableView
    • equals

      public boolean equals​(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is equal to the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code for this TablePosition object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this TablePosition object.