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 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 and Description |
---|---|
protected class |
MOTableRelation.RelationShipListener |
Constructor and 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 and 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() |
org.snmp4j.smi.OID[] |
getDependentIndexes(BaseRow baseRow)
Returns the dependent indexes for the specified base row.
|
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.
|
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()
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.protected void addDependentRows(BaseRow baseTableRow)
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.