Class ColumnsLayoutCache.LayoutInfo

java.lang.Object
io.github.palexdev.virtualizedfx.table.ColumnsLayoutCache.LayoutInfo
All Implemented Interfaces:
Comparable<ColumnsLayoutCache<T>.LayoutInfo>
Enclosing class:
ColumnsLayoutCache<T>

public class ColumnsLayoutCache.LayoutInfo extends Object implements Comparable<ColumnsLayoutCache<T>.LayoutInfo>
Wrapper class for layout data related to a specific VFXTableColumn. This stores: its index [init:-1], its width as a DoubleBinding, its x position [default:-1.0], and its visibility [default:null].

Width handling

For better performance, the column's width is stored as a binding, so the value is computed lazily (only upon request). Invalidation is handled "manually". Check createWidthBinding() for more details.

Null visibility? What?

This uses null as a possible visibility value, to indicate that it is invalid and thus must be computed.

  • Constructor Details

  • Method Details

    • getColumn

      public VFXTableColumn<T,?> getColumn()
      Returns:
      the column instance the layout data refers to
    • getIndex

      public int getIndex()
      Returns:
      the column's index retrieved the first time by VFXTable.indexOf(VFXTableColumn) (then cached)
    • getWidth

      public double getWidth()
      Calls DoubleBinding.get() on the column's width binding.
    • isWidthValid

      public boolean isWidthValid()
      Returns:
      whether DoubleBinding.isValid() is true
    • getPos

      public double getPos()
      Returns:
      the stored column's x position
    • isVisible

      public Boolean isVisible()
      Returns:
      whether the column is visible in the viewport. Beware, this can also return null to indicate that the value is invalid and should be re-computed by the cache
    • compareTo

      public int compareTo(ColumnsLayoutCache<T>.LayoutInfo o)
      Specified by:
      compareTo in interface Comparable<ColumnsLayoutCache<T>.LayoutInfo>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object