jimmc.roots
Class PolyModel

java.lang.Object
  |
  +--jimmc.roots.PolyModel

public class PolyModel
extends java.lang.Object

A model for either a single record or multiple records from the database.


Field Summary
protected  RootsBase base
          Our base database.
protected  DatabaseModel db
          Our database model.
protected  java.lang.String[] keys
          Our key list.
protected  RootsRecord singleRecord
          If only one key, the record for that key.
 
Constructor Summary
PolyModel(DatabaseModel db, java.lang.String[] keys)
          Create a new model.
 
Method Summary
protected  void fillLayout(Layout layout)
          Debug - Fill in the layout with boxes.
 int getCount()
          Get the count of keys.
 java.lang.String getDisplayCommand(java.lang.String format, boolean includeKeys)
          Get the command we use to generate our display.
 java.lang.String[] getKeys()
          Get the keys for this model.
protected  Layout getOutputLayout(java.lang.String format, boolean includeKeys)
          Get the layout and route it.
 java.lang.String getOutputText(java.lang.String format, boolean includeKeys)
          Get the long text string based on format.
 java.lang.String[] getSelection(java.lang.String what)
          Get a selection relative to this selection.
 java.lang.String getSummary()
          Get the summary line to display for this model.
protected  java.lang.String getTreeparText(java.lang.String format, boolean includeKeys)
          Get the text dump of a treepar layout.
 java.lang.String getType()
          Get the type for this model.
protected  java.lang.String[] pruneRedundantTreeKeys(java.lang.String[] sel)
          Prune the list of items to remove redundant nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

db

protected DatabaseModel db
Our database model.

keys

protected java.lang.String[] keys
Our key list.

base

protected RootsBase base
Our base database.

singleRecord

protected RootsRecord singleRecord
If only one key, the record for that key.
Constructor Detail

PolyModel

public PolyModel(DatabaseModel db,
                 java.lang.String[] keys)
Create a new model.
Method Detail

getSelection

public java.lang.String[] getSelection(java.lang.String what)
Get a selection relative to this selection.
Parameters:
what - the selction, such as father, mother, or children.

getKeys

public java.lang.String[] getKeys()
Get the keys for this model.

getCount

public int getCount()
Get the count of keys.

getType

public java.lang.String getType()
Get the type for this model.

getSummary

public java.lang.String getSummary()
Get the summary line to display for this model.

getDisplayCommand

public java.lang.String getDisplayCommand(java.lang.String format,
                                          boolean includeKeys)
Get the command we use to generate our display.

getOutputText

public java.lang.String getOutputText(java.lang.String format,
                                      boolean includeKeys)
Get the long text string based on format.

getTreeparText

protected java.lang.String getTreeparText(java.lang.String format,
                                          boolean includeKeys)
Get the text dump of a treepar layout.

getOutputLayout

protected Layout getOutputLayout(java.lang.String format,
                                 boolean includeKeys)
Get the layout and route it.

pruneRedundantTreeKeys

protected java.lang.String[] pruneRedundantTreeKeys(java.lang.String[] sel)
Prune the list of items to remove redundant nodes. RootsPerson nodes are replaced by their parent union node (if defined), then duplicate nodes are removed from the list.

fillLayout

protected void fillLayout(Layout layout)
Debug - Fill in the layout with boxes.