public class KahinaUnlayeredMemTree extends KahinaTree
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> |
children |
protected java.util.Set<java.lang.Integer> |
collapsed |
protected java.util.Map<java.lang.Integer,java.lang.String> |
edgeLabels |
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
layers |
protected java.util.Map<java.lang.Integer,java.lang.String> |
nodeCaptions |
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
parents |
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
status |
decider
needsUpdate
Constructor and Description |
---|
KahinaUnlayeredMemTree() |
KahinaUnlayeredMemTree(LayerDecider decider) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(int parent,
int child) |
void |
addChildAddListener(KahinaTreeChildAddListener listener) |
void |
addNode(int id,
java.lang.String caption,
java.lang.String label,
int nodeStatus) |
int |
addNode(java.lang.String caption,
java.lang.String label,
int nodeStatus) |
void |
clear()
Clears the tree model.
|
void |
collapse(int nodeID) |
protected void |
collectLeaves(int nodeID,
java.util.List<java.lang.Integer> leaves) |
void |
decollapse(int nodeID) |
void |
decollapseAll() |
java.util.Set<java.lang.Integer> |
getAllNodeIDs()
Gets all the node IDs in ascending order, useful for bottom-up traversal.
|
int |
getBestEquivalent(int nodeID,
int layerID) |
java.util.List<java.lang.Integer> |
getChildren(int nodeID) |
java.util.List<java.lang.Integer> |
getChildren(int nodeID,
int layerID,
boolean stopAtCornerstones) |
java.lang.String |
getEdgeLabel(int nodeID) |
int |
getLayer(int nodeID) |
java.util.List<java.lang.Integer> |
getLeaves() |
protected int |
getNextFreeID() |
java.lang.String |
getNodeCaption(int nodeID) |
int |
getNodeStatus(int nodeID) |
int |
getParent(int nodeID) |
int |
getParent(int nodeID,
int layerID) |
int |
getRootID(int layerID) |
int |
getRootID(int layerID,
int referenceNode) |
int |
getSize() |
static KahinaTree |
importXML(org.w3c.dom.Document dom) |
boolean |
isCollapsed(int nodeID) |
void |
removeChildAddListener(KahinaTreeChildAddListener listener) |
boolean |
removeLeaf(int id) |
void |
setEdgeLabel(int nodeID,
java.lang.String label) |
void |
setLayer(int nodeID,
int layer) |
void |
setNodeCaption(int nodeID,
java.lang.String caption) |
void |
setNodeStatus(int nodeID,
int newStatus) |
java.lang.String |
toString() |
announceChange, exportXML, getLayerDecider, getPrimaryModel, getReferenceNode, getRootID, hasCollapsedAncestor, needsUpdate, setLayerDecider, setPrimaryModel, setReferenceNode, setRootID, toggleCollapse
requireUpdate
protected java.util.Map<java.lang.Integer,java.lang.Integer> parents
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> children
protected java.util.Map<java.lang.Integer,java.lang.String> nodeCaptions
protected java.util.Map<java.lang.Integer,java.lang.String> edgeLabels
protected java.util.Map<java.lang.Integer,java.lang.Integer> status
protected java.util.Set<java.lang.Integer> collapsed
protected java.util.Map<java.lang.Integer,java.lang.Integer> layers
public KahinaUnlayeredMemTree()
public KahinaUnlayeredMemTree(LayerDecider decider)
public java.util.Set<java.lang.Integer> getAllNodeIDs()
getAllNodeIDs
in class KahinaTree
public int getRootID(int layerID)
getRootID
in class KahinaTree
public int getRootID(int layerID, int referenceNode)
getRootID
in class KahinaTree
public void addChild(int parent, int child)
addChild
in class KahinaTree
public void addChildAddListener(KahinaTreeChildAddListener listener)
addChildAddListener
in class KahinaTree
public void removeChildAddListener(KahinaTreeChildAddListener listener)
removeChildAddListener
in class KahinaTree
public int getParent(int nodeID, int layerID)
getParent
in class KahinaTree
public int getBestEquivalent(int nodeID, int layerID)
getBestEquivalent
in class KahinaTree
public int getLayer(int nodeID)
getLayer
in class KahinaTree
public void setLayer(int nodeID, int layer)
setLayer
in class KahinaTree
public int getParent(int nodeID)
getParent
in class KahinaTree
public java.lang.String getNodeCaption(int nodeID)
getNodeCaption
in class KahinaTree
public void setNodeCaption(int nodeID, java.lang.String caption)
setNodeCaption
in class KahinaTree
public java.lang.String getEdgeLabel(int nodeID)
getEdgeLabel
in class KahinaTree
public void setEdgeLabel(int nodeID, java.lang.String label)
setEdgeLabel
in class KahinaTree
public int getNodeStatus(int nodeID)
getNodeStatus
in class KahinaTree
public void setNodeStatus(int nodeID, int newStatus)
setNodeStatus
in class KahinaTree
public java.util.List<java.lang.Integer> getChildren(int nodeID)
getChildren
in class KahinaTree
public java.util.List<java.lang.Integer> getChildren(int nodeID, int layerID, boolean stopAtCornerstones)
getChildren
in class KahinaTree
public java.util.List<java.lang.Integer> getLeaves()
getLeaves
in class KahinaTree
protected void collectLeaves(int nodeID, java.util.List<java.lang.Integer> leaves)
collectLeaves
in class KahinaTree
public boolean isCollapsed(int nodeID)
isCollapsed
in class KahinaTree
public void collapse(int nodeID)
collapse
in class KahinaTree
public void decollapse(int nodeID)
decollapse
in class KahinaTree
public void decollapseAll()
decollapseAll
in class KahinaTree
public int addNode(java.lang.String caption, java.lang.String label, int nodeStatus)
addNode
in class KahinaTree
protected int getNextFreeID()
public void clear()
KahinaTree
super.clear()
.clear
in class KahinaTree
public int getSize()
getSize
in class KahinaTree
public static KahinaTree importXML(org.w3c.dom.Document dom)
public void addNode(int id, java.lang.String caption, java.lang.String label, int nodeStatus)
addNode
in class KahinaTree
public java.lang.String toString()
toString
in class java.lang.Object
public boolean removeLeaf(int id)
removeLeaf
in class KahinaTree