archimate.util
Class TagTree

java.lang.Object
  extended by archimate.util.TagTree

public class TagTree
extends java.lang.Object

This class implements the tree containing all archiMateTags in a hierarchical structure

Author:
Samuel Esposito

Field Summary
static java.lang.String ROOT
          Tree root tag
 
Constructor Summary
TagTree()
          Creates a new tree, sets the tree root and marks it as selected
 
Method Summary
 TagNode current()
           
 TagNode getNode(TagNode node, java.lang.String tag)
          Searches for a node with a certain tag in the nodes children
static java.util.ArrayList<TagNode> getUnvisited(TagNode node)
          Searches the node children for all unvisited nodes
 int nodes()
          Returns the number of nodes in the tree
 void printTree()
          Prints a list of all tree nodes and their state to the standard output for debug purposes
 void resetVisited()
          Marks all nodes in the tree as visited
 TagNode root()
           
 void setCurrent(TagNode node)
          Marks a node as selected
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT

public static final java.lang.String ROOT
Tree root tag

See Also:
Constant Field Values
Constructor Detail

TagTree

public TagTree()
Creates a new tree, sets the tree root and marks it as selected

Method Detail

root

public TagNode root()
Returns:
the root of the tree

current

public TagNode current()
Returns:
the node currently selected

nodes

public int nodes()
Returns the number of nodes in the tree

Returns:
The number of nodes in the tree

setCurrent

public void setCurrent(TagNode node)
Marks a node as selected

Parameters:
node - the node you want to select

printTree

public void printTree()
Prints a list of all tree nodes and their state to the standard output for debug purposes


getNode

public TagNode getNode(TagNode node,
                       java.lang.String tag)
Searches for a node with a certain tag in the nodes children

Parameters:
node - The node which children are searched
tag - The tag to match
Returns:
A child having a matching tag

getUnvisited

public static java.util.ArrayList<TagNode> getUnvisited(TagNode node)
Searches the node children for all unvisited nodes

Parameters:
node - The node which children are searched
Returns:
A list of nodes which are unvisited

resetVisited

public void resetVisited()
Marks all nodes in the tree as visited