|
||||||||||
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.file.AddSupportValuesEdit
public class AddSupportValuesEdit
Nested Class Summary | |
---|---|
static class |
AddSupportValuesEdit.TargetType
|
Field Summary | |
---|---|
static DecimalFormat |
CONFLICT_DECIMAL_FORMAT
|
static String |
CONFLICT_NAME
|
private TextElementDataAdapter |
conflictAdapter
The node/branch data column to write imported conflict values to |
static String |
KEY_LEAF_REFERENCE
|
private Vector<TextElementData> |
leafValues
|
static int |
MAX_TERMINAL_ERROR_COUNT
|
private boolean |
processRooted
|
static NodeNameAdapter |
SOURCE_LEAFS_ADAPTER
|
private NodeBranchDataAdapter |
sourceAdapter
The node/branch data to be imported (node names or branch lengths) |
private Document |
src
|
static DecimalFormat |
SUPPORT_DECIMAL_FORMAT
|
static String |
SUPPORT_NAME
|
private TextElementDataAdapter |
supportAdapter
The node/branch data column to write imported support values to |
private TextElementDataAdapter |
targetLeafsAdapter
The column that contains the terminal identifiers in the target document (usually nodes names) |
Fields inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit |
---|
document |
Constructor Summary | |
---|---|
AddSupportValuesEdit(Document document,
Document src,
TextElementDataAdapter terminalsAdapter,
AddSupportValuesEdit.TargetType targetType,
String idPrefix,
NodeBranchDataAdapter sourceAdapter,
boolean processRooted)
|
Method Summary | |
---|---|
private void |
addLeafFields(Node root,
TextElementDataAdapter adapter)
Adds a boolean field which indicates the leafs located under root to
the attribute map of root . |
private void |
addLeafList(List<TextElementData> list,
Node root,
TextElementDataAdapter adapter)
Fills the specified list with the values of all leafs under root . |
private String |
compareLeafs()
|
static AddSupportValuesEdit |
createInstance(Document document,
Document src,
TextElementDataAdapter terminalsAdapter,
AddSupportValuesEdit.TargetType targetType,
String idPrefix,
boolean importNodeNames,
boolean processRooted)
Returns a new instance of AddSupportValuesEdit or null
if the given source document contains internal node names that are not decimal. |
private double |
findHighestConflict(Node root,
double highest,
Node targetNode,
NodeInfo info)
This method is the recursive part called by findHighestConflict . |
private NodeInfo |
findSourceNodeWithAllLeafs(Node sourceRoot,
LeafField targetLeafs)
|
private LeafField |
getLeafField(Node node)
|
private int |
getLeafIndex(TextElementData value)
|
String |
getPresentationName()
|
private double |
getSupportValue(Node node)
|
private static boolean |
internalsAreDecimal(Node root,
NodeBranchDataAdapter adapter)
Tests if all internal nodes in the subtree under root contain
decimal values. |
protected void |
performRedo()
|
private void |
processSubtree(Node targetRoot)
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, getIsSubedit, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, setIsSubedit |
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
public static final NodeNameAdapter SOURCE_LEAFS_ADAPTER
private Document src
private TextElementDataAdapter targetLeafsAdapter
private NodeBranchDataAdapter sourceAdapter
private TextElementDataAdapter supportAdapter
private TextElementDataAdapter conflictAdapter
private Vector<TextElementData> leafValues
private boolean processRooted
Constructor Detail |
---|
public AddSupportValuesEdit(Document document, Document src, TextElementDataAdapter terminalsAdapter, AddSupportValuesEdit.TargetType targetType, String idPrefix, NodeBranchDataAdapter sourceAdapter, boolean processRooted)
Method Detail |
---|
private static boolean internalsAreDecimal(Node root, NodeBranchDataAdapter 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 foundpublic static AddSupportValuesEdit createInstance(Document document, Document src, TextElementDataAdapter terminalsAdapter, AddSupportValuesEdit.TargetType targetType, String idPrefix, boolean importNodeNames, boolean processRooted)
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.processRooted
- defines whether the two specified trees shall be merged rooted or not
(no matter if the specified documents are rooted or not)
AddSupportValuesEdit
or null
protected void performRedo()
performRedo
in class ComplexDocumentEdit
private void addLeafList(List<TextElementData> list, Node root, TextElementDataAdapter adapter)
root
.
list
- root
- adapter
- private String compareLeafs()
private LeafField getLeafField(Node node)
private int getLeafIndex(TextElementData value)
private void addLeafFields(Node root, TextElementDataAdapter adapter)
root
to
the attribute map of root
.
root
- the root of the subtreeprivate NodeInfo findSourceNodeWithAllLeafs(Node sourceRoot, LeafField targetLeafs)
private double getSupportValue(Node node)
private double findHighestConflict(Node root, double highest, Node targetNode, NodeInfo info)
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 valuetargetNode
- the node in the target document to attach a support value toinfo
- information about the node in the source document which contains all terminals of
targetNode
in its subtree
private void processSubtree(Node targetRoot)
targetRoot
- the root of the subtree to add support values to (a node of the
target document)public String getPresentationName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |