BaseRow
- The row type of the base table.DependentRow
- The row type of the dependent table.public class MOTableRelation<BaseRow extends MOTableRow,DependentRow extends MOTableRow>
extends java.lang.Object
MOTableRelation
class models table relations like sparse
table relationship and augmentation. This class implements the augmentation
relationship. In order to implement a sparse table relationship, sub-classing
MOTableRelation
is needed and the methods
hasDependentRow(BaseRow)
and getDependentIndexes(BaseRow)
must be overwritten
then.Modifier and Type | Class | Description |
---|---|---|
protected class |
MOTableRelation.RelationShipListener |
Constructor | Description |
---|---|
MOTableRelation(MOTable<BaseRow,? extends MOColumn,? extends MOTableModel<BaseRow>> baseTable,
MOTable<DependentRow,? extends MOColumn,? extends MOTableModel<DependentRow>> dependentTable) |
Creates a table relation from a base table and the dependent table.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
addDependentRows(BaseRow baseTableRow) |
Adds all dependent rows for the specified base table row to the dependent
table.
|
void |
createRelationShip() |
Actually sets up the relationship between base and dependent table by
adding this instance as row listener to the base table.
|
protected MOTableRowListener<BaseRow> |
createRelationShipListener() |
|
MOTable<BaseRow,? extends MOColumn,? extends MOTableModel<BaseRow>> |
getBaseTable() |
|
org.snmp4j.smi.OID[] |
getDependentIndexes(BaseRow baseRow) |
Returns the dependent indexes for the specified base row.
|
MOTable<DependentRow,? extends MOColumn,? extends MOTableModel<DependentRow>> |
getDependentTable() |
|
MOTableRowListener<BaseRow> |
getRelationShipListener() |
|
boolean |
hasDependentRow(BaseRow baseTableRow) |
Indicates whether the specified baseTableRow has any dependent rows.
|
protected MOTableRow[] |
removeDependentRows(BaseRow baseTableRow) |
Removes all dependent rows for the specified base table row
from the dependent table.
|
void |
removeRelationShip() |
Removes the relationship between base and dependent table by
removing this instance as row listener from the base table.
|
protected void |
updateDependentRows(BaseRow baseTableRow) |
Update the
MOTableRow.getBaseRow() reference all dependent rows for the specified base table row in
the dependent table. |
public MOTableRelation(MOTable<BaseRow,? extends MOColumn,? extends MOTableModel<BaseRow>> baseTable, MOTable<DependentRow,? extends MOColumn,? extends MOTableModel<DependentRow>> dependentTable)
createRelationShip()
needs to be called.baseTable
- the base table.dependentTable
- the dependent (augmenting) table.public void createRelationShip()
public void removeRelationShip()
protected MOTableRowListener<BaseRow> createRelationShipListener()
public boolean hasDependentRow(BaseRow baseTableRow)
true
because the default
implementation represents an augmentation relationship.
Overwrite this method in a sub-class to implement a sparse table
relationship.baseTableRow
- a row of the base table.true
if the row has dependent rows.public org.snmp4j.smi.OID[] getDependentIndexes(BaseRow baseRow)
baseRow
- a row of the base table.public MOTable<BaseRow,? extends MOColumn,? extends MOTableModel<BaseRow>> getBaseTable()
public MOTable<DependentRow,? extends MOColumn,? extends MOTableModel<DependentRow>> getDependentTable()
public MOTableRowListener<BaseRow> getRelationShipListener()
protected void addDependentRows(BaseRow baseTableRow)
createRelationShip()
has been called.baseTableRow
- a row of the base table.protected void updateDependentRows(BaseRow baseTableRow)
MOTableRow.getBaseRow()
reference all dependent rows for the specified base table row in
the dependent table. This method is automatically called if createRelationShip()
has been called.baseTableRow
- a row of the base table.protected MOTableRow[] removeDependentRows(BaseRow baseTableRow)
createRelationShip()
has been called.baseTableRow
- a row of the base table.Copyright © 2018 SNMP4J.org. All rights reserved.