public final class TableDefinition extends java.lang.Object implements java.lang.Iterable<ColumnDefinition<?>>, java.io.Serializable
Constructor and Description |
---|
TableDefinition(java.lang.String tableName,
java.lang.String tableDescription,
ColumnDefinition<?>... columns)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
ColumnDefinition<?> |
getColumnDefinition(int columnIndex)
Returns the column definition at the given index.
|
ColumnDefinition<?> |
getColumnDefinition(java.lang.String columnName)
Returns the column definition with the given column name.
|
ColumnDefinition<?>[] |
getColumnDefinitions()
Returns the column definitions of this table as an array.
|
java.lang.String |
getColumnName(int column)
Returns the name of the given column.
|
java.lang.String[] |
getColumnNames()
Returns the names (titles) of all columns.
|
int |
getNumColumns()
Returns the number of defined columns.
|
int |
getSize()
Returns the number of defined columns.
|
java.lang.String |
getTableDescription()
Returns a description of the meaning and intended usage of the table.
|
java.lang.String |
getTableName()
Returns the name (title) of the table.
|
int |
hashCode() |
java.util.Iterator<ColumnDefinition<?>> |
iterator() |
public TableDefinition(java.lang.String tableName, java.lang.String tableDescription, ColumnDefinition<?>... columns) throws java.lang.NullPointerException
TableHelper
for supported column types.tableName
- The name (title) of the table. Should be a single short line.tableDescription
- Description of the meaning and intended usage of the table. Might contain multiple lines (separated by line breaks).columns
- The columns of the table.java.lang.NullPointerException
- Thrown if tableName, or tableDescription is null.public java.util.Iterator<ColumnDefinition<?>> iterator()
iterator
in interface java.lang.Iterable<ColumnDefinition<?>>
public java.lang.String getTableName()
public java.lang.String getTableDescription()
public int getNumColumns()
getSize()
.public int getSize()
getNumColumns()
.public ColumnDefinition<?> getColumnDefinition(int columnIndex) throws java.lang.IndexOutOfBoundsException
columnIndex
- Column index.java.lang.IndexOutOfBoundsException
- Thrown if columnIndex is invalid.public ColumnDefinition<?> getColumnDefinition(java.lang.String columnName) throws TableException
columnName
- Column name.TableException
- Thrown if column definition with given column name does not exist.public java.lang.String getColumnName(int column) throws java.lang.IndexOutOfBoundsException
column
- Index of the column.java.lang.IndexOutOfBoundsException
- Thrown if column index is invalid.public java.lang.String[] getColumnNames()
public ColumnDefinition<?>[] getColumnDefinitions()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object