|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.bioinfweb.treegraph.document.undo.DocumentEdit
info.bioinfweb.treegraph.document.undo.ComplexDocumentEdit
info.bioinfweb.treegraph.document.undo.edit.AddSupportValuesEdit
public class AddSupportValuesEdit
| Nested Class Summary | |
|---|---|
private class |
AddSupportValuesEdit.LeafList
|
static class |
AddSupportValuesEdit.TargetType
|
| Field Summary | |
|---|---|
static DecimalFormat |
CONFLICT_DECIMAL_FORMAT
|
static String |
CONFLICT_NAME
|
private NodeDataAdapter |
conflictAdapter
|
static String |
KEY_LEAF_REFERENCE
|
static int |
MAX_TERMINAL_ERROR_COUNT
|
private NodeDataAdapter |
sourceAdapter
|
private Document |
src
|
static DecimalFormat |
SUPPORT_DECIMAL_FORMAT
|
static String |
SUPPORT_NAME
|
private NodeDataAdapter |
supportAdapter
|
private NodeDataAdapter |
terminalsAdapter
|
| Fields inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit |
|---|
document |
| Constructor Summary | |
|---|---|
private |
AddSupportValuesEdit(Document document,
Document src,
NodeDataAdapter terminalsAdapter,
AddSupportValuesEdit.TargetType targetType,
String idPrefix,
NodeDataAdapter sourceAdapter)
|
| Method Summary | |
|---|---|
private void |
addLeafReferences(Node root)
Adds direkt references to all leaves of the subtree under root to
the attribute map of root. |
static AddSupportValuesEdit |
createInstance(Document document,
Document src,
NodeDataAdapter terminalsAdapter,
AddSupportValuesEdit.TargetType targetType,
String idPrefix,
boolean importNodeNames)
Returns a new instance of AddSupportValuesEdit or null
if the given source document contains internal node names that are not decimal. |
private Node |
findDeepestNodeWithLeafs(AddSupportValuesEdit.LeafList leafs)
Finds the deepest node in the source document which has a subtree that contains all the specified leafs. |
private double |
findHighestConflict(Node root,
AddSupportValuesEdit.LeafList leafs)
Finds the highest conflicting support value in the subtree under root. |
private double |
findHighestConflictRek(Node root,
double highest,
AddSupportValuesEdit.LeafList leafs)
This method is the recursive part called by findHighestConflict. |
private Node |
findSubnodeWithLeafs(AddSupportValuesEdit.LeafList leafs,
Node parent)
Finds the direct subnode under root that contains all the specified
leafs. |
private AddSupportValuesEdit.LeafList |
getLeafList(Node node)
Returns the leaf list of node that is stored in its attribute map. |
String |
getPresentationName()
|
private double |
getSupportValue(Node node)
|
private static boolean |
internalsAreDecimal(Node root,
NodeDataAdapter adapter)
Tests if all internal nodes in the subtree under root contain
decimal values. |
protected void |
performRedo()
|
private void |
processSubtree(Node root)
Finds the support or conflict values in the source document. |
| Methods inherited from class info.bioinfweb.treegraph.document.undo.ComplexDocumentEdit |
|---|
findEquivilant, findEquivilant, redo, undo |
| Methods inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit |
|---|
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SUPPORT_NAME
public static final String CONFLICT_NAME
public static final DecimalFormat SUPPORT_DECIMAL_FORMAT
public static final DecimalFormat CONFLICT_DECIMAL_FORMAT
public static final String KEY_LEAF_REFERENCE
public static final int MAX_TERMINAL_ERROR_COUNT
private NodeDataAdapter sourceAdapter
private Document src
private NodeDataAdapter terminalsAdapter
private NodeDataAdapter supportAdapter
private NodeDataAdapter conflictAdapter
| Constructor Detail |
|---|
private AddSupportValuesEdit(Document document,
Document src,
NodeDataAdapter terminalsAdapter,
AddSupportValuesEdit.TargetType targetType,
String idPrefix,
NodeDataAdapter sourceAdapter)
| Method Detail |
|---|
public static AddSupportValuesEdit createInstance(Document document,
Document src,
NodeDataAdapter terminalsAdapter,
AddSupportValuesEdit.TargetType targetType,
String idPrefix,
boolean importNodeNames)
AddSupportValuesEdit or null
if the given source document contains internal node names that are not decimal.
document - - the document to add the support values tosrc - - the document to obtain the support values frimterminalsAdapter - - the adapter to obtain the terminal names from the target
documenttargetType - - the type of node data to store the new support valuesidPrefix - - the prefix of the IDs that will be given to the new support
(and conflict values)importNodeNames - - If true the internal node names are imported as
support valus, otherwise the internal branch lengths are used.
AddSupportValuesEdit or null
private static boolean internalsAreDecimal(Node root,
NodeDataAdapter adapter)
root contain
decimal values.
root - - the root of the subtree to be checkedadapter - - the adapter to obtain the data from the nodes
true if only decimal values are foundprivate AddSupportValuesEdit.LeafList getLeafList(Node node)
node that is stored in its attribute map.
node - - the node of the returned leaf list
null if the node contains no leaf
listprivate void addLeafReferences(Node root)
root to
the attribute map of root.
root - - the root of the subtree
private Node findSubnodeWithLeafs(AddSupportValuesEdit.LeafList leafs,
Node parent)
Finds the direct subnode under root that contains all the specified
leafs.
Note that this method should only be used with nodes of the source document
because of the correct use of the NodeDataAdapters.
leafs - - the leaf list of a node from the target documentparent - - the direct parent node of the nodes to be searched (a node of the
source document)
null if none is foundprivate Node findDeepestNodeWithLeafs(AddSupportValuesEdit.LeafList leafs)
leafs - - the leaf list of a node from the target document
private double getSupportValue(Node node)
private double findHighestConflict(Node root,
AddSupportValuesEdit.LeafList leafs)
root.
(Root itsself is not included.) Conflicting nodes have to contain at least one
leaf node of the leafs the original node had and at least one leaf node the
original node did not have.
root - - the root of the subtree to be searched (a node in the source document)highest - - the initial support valueleafs - - the leaf list of the node of the target document
private double findHighestConflictRek(Node root,
double highest,
AddSupportValuesEdit.LeafList leafs)
findHighestConflict.
The only difference between the two is that this method can return the support
value of root itsself as findHighestConflict does not.
root - - the root of the subtree to be searched (a node in the source document)highest - - the initial support valueleafs - - the leaf list of the node of the target document
private void processSubtree(Node root)
root - - the root of the subtree to add support values to (a node of the
target document)protected void performRedo()
performRedo in class ComplexDocumentEditpublic String getPresentationName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||