Class TableInfo

java.lang.Object
org.deltava.beans.stats.TableInfo
All Implemented Interfaces:
Serializable, Comparable<TableInfo>

public class TableInfo extends Object implements Serializable, Comparable<TableInfo>
A system bean to store JDBC table data.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TableInfo(String tableName)
    Creates a new TableInfo bean for the specified database table.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares two TableInfo objects by comparing the table names.
    boolean
     
    int
    Returns the average row size.
    long
    Returns the size of the table's indices.
    Returns the table name.
    long
    Returns the number of rows in the table.
    long
    Returns the size of the table.
    int
    Returns the table name's hash code.
    void
    setIndexSize(long idxSize)
    Updates the size of the table's indices.
    void
    setRows(long rows)
    Updates the number of rows in the table.
    void
    setSize(long tableSize)
    Updates the size of the table.

    Methods inherited from class java.lang.Object

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

    • TableInfo

      public TableInfo(String tableName)
      Creates a new TableInfo bean for the specified database table.
      Parameters:
      tableName - the name of the table
      Throws:
      NullPointerException - if tableName is null
      See Also:
  • Method Details

    • getName

      public String getName()
      Returns the table name.
      Returns:
      the table name
    • getRows

      public long getRows()
      Returns the number of rows in the table.
      Returns:
      the number of rows
      See Also:
    • getAverageRowLength

      public int getAverageRowLength()
      Returns the average row size.
      Returns:
      the average bytes per row
    • getSize

      public long getSize()
      Returns the size of the table.
      Returns:
      the size of the table in bytes
      See Also:
    • getIndexSize

      public long getIndexSize()
      Returns the size of the table's indices.
      Returns:
      the size of the indices in bytes
      See Also:
    • setRows

      public void setRows(long rows)
      Updates the number of rows in the table.
      Parameters:
      rows - the number of rows
      See Also:
    • setSize

      public void setSize(long tableSize)
      Updates the size of the table.
      Parameters:
      tableSize - the size of the table in bytes
      See Also:
    • setIndexSize

      public void setIndexSize(long idxSize)
      Updates the size of the table's indices.
      Parameters:
      idxSize - the size of the indices in bytes
      See Also:
    • hashCode

      public int hashCode()
      Returns the table name's hash code.
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(TableInfo ti2)
      Compares two TableInfo objects by comparing the table names.
      Specified by:
      compareTo in interface Comparable<TableInfo>
    • equals

      public boolean equals(Object o2)
      Overrides:
      equals in class Object