gov.sns.tools.data
Class EditContext

java.lang.Object
  |
  +--gov.sns.tools.data.EditContext

public class EditContext
extends java.lang.Object

EditContext manages dynamic data held in all associated tables.


Nested Class Summary
static interface EditContext.ContextMessage
          Send notification about changes affecting this edit context
 
Field Summary
protected  MessageCenter messageCenter
           
protected  EditContext.ContextMessage noticeProxy
          Map of tables by name
protected  java.util.Map tableMapByGroup
           
protected  java.util.Map tableMapByName
          Map of tables associated with group
 
Constructor Summary
EditContext()
          Creates new EditContext
 
Method Summary
 void addListener(EditContext.ContextMessage listener)
           
 void addTablesToGroup(java.util.Collection newTables, java.lang.String group)
          Add the tables to the edit context.
 void addTableToGroup(DataTable newTable, java.lang.String group)
          Add the table to the edit context.
 void clear()
           
 DataTable getTable(java.lang.String name)
          Get the table associated with the specified table name.
 java.util.Collection getTableGroups()
          Get all table groups
 java.util.Collection getTableNames()
          Get the collection of all table names associated with this context.
 java.util.Collection getTables()
          Get the collection of all tables in the edit context.
 java.util.Collection getTablesForGroup(java.lang.String group)
          Get all tables associated with the specified group
 GenericRecord recordForNode(java.lang.String tableName, java.lang.String nodeId)
          Get a single record from the table associated with the node.
 java.util.Collection records(DataTable table, java.util.Map bindings)
          Get the records from the table where the bindings map is valid.
 java.util.Collection records(java.lang.String tableName)
          Get all of the records from the table given by the table name.
 java.util.Collection records(java.lang.String tableName, java.util.Map bindings)
          Get the records from the table where the bindings map is valid.
 java.util.Collection records(java.lang.String tableName, java.lang.String key, java.lang.Object value)
          Get the records from the table where the value for the specified key matches.
 java.util.Collection recordsForNode(java.lang.String tableName, java.lang.String nodeId)
          Get the records from the table associated with the node.
 void remove(DataTable aTable)
          Remove the table from the edit context.
 void removeListener(EditContext.ContextMessage listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageCenter

protected MessageCenter messageCenter

tableMapByGroup

protected java.util.Map tableMapByGroup

tableMapByName

protected java.util.Map tableMapByName
Map of tables associated with group


noticeProxy

protected EditContext.ContextMessage noticeProxy
Map of tables by name

Constructor Detail

EditContext

public EditContext()
Creates new EditContext

Method Detail

addListener

public void addListener(EditContext.ContextMessage listener)

removeListener

public void removeListener(EditContext.ContextMessage listener)

clear

public void clear()

getTable

public DataTable getTable(java.lang.String name)
Get the table associated with the specified table name.


getTableNames

public java.util.Collection getTableNames()
Get the collection of all table names associated with this context.


getTables

public java.util.Collection getTables()
Get the collection of all tables in the edit context.


addTableToGroup

public void addTableToGroup(DataTable newTable,
                            java.lang.String group)
Add the table to the edit context.


addTablesToGroup

public void addTablesToGroup(java.util.Collection newTables,
                             java.lang.String group)
Add the tables to the edit context.


getTableGroups

public java.util.Collection getTableGroups()
Get all table groups


getTablesForGroup

public java.util.Collection getTablesForGroup(java.lang.String group)
Get all tables associated with the specified group


remove

public void remove(DataTable aTable)
Remove the table from the edit context.


records

public java.util.Collection records(java.lang.String tableName)
Get all of the records from the table given by the table name.


records

public java.util.Collection records(java.lang.String tableName,
                                    java.util.Map bindings)
Get the records from the table where the bindings map is valid.


records

public java.util.Collection records(DataTable table,
                                    java.util.Map bindings)
Get the records from the table where the bindings map is valid.


records

public java.util.Collection records(java.lang.String tableName,
                                    java.lang.String key,
                                    java.lang.Object value)
Get the records from the table where the value for the specified key matches.


recordsForNode

public java.util.Collection recordsForNode(java.lang.String tableName,
                                           java.lang.String nodeId)
Get the records from the table associated with the node.


recordForNode

public GenericRecord recordForNode(java.lang.String tableName,
                                   java.lang.String nodeId)
Get a single record from the table associated with the node.