com.rapidminer.tools
Class GroupTree

java.lang.Object
  extended by com.rapidminer.tools.GroupTree
All Implemented Interfaces:
java.lang.Comparable<GroupTree>

public class GroupTree
extends java.lang.Object
implements java.lang.Comparable<GroupTree>

A group tree manages operator descriptions in a tree like manner. This is useful to present the operators in groups and subgroups and eases operator selection in the GUI.

Author:
Ingo Mierswa

Constructor Summary
GroupTree(GroupTree other)
          Clone constructor.
GroupTree(java.lang.String name)
          Creates a new group tree with no operators and children.
 
Method Summary
 void addOperatorDescription(OperatorDescription description)
          Adds an operator to this group.
 void addSubGroup(GroupTree child)
          Adds a subgroup to this group.
 java.lang.Object clone()
          Returns a deep clone of this tree.
 int compareTo(GroupTree o)
           
 boolean equals(java.lang.Object o)
           
 java.util.Set<OperatorDescription> getAllOperatorDescriptions()
          Returns all operator in this group and recursively the operators of all children.
 int getIndexOfSubGroup(GroupTree child)
          Returns the index of the given subgroup or -1 if the sub group is not a child of this node.
 java.lang.String getMainGroupName()
          Returns the main group name, i.e. the name of the first parent group under the root.
 java.lang.String getName()
          Returns the name of this group.
 java.util.Set<OperatorDescription> getOperatorDescriptions()
          Returns all operator descriptions in this group or an empty list if this group does not contain any operators.
 GroupTree getSubGroup(int index)
          Returns the i-th sub group.
 GroupTree getSubGroup(java.lang.String name)
          Returns the subgroup with the given name.
 java.util.Collection<GroupTree> getSubGroups()
          Returns a set of all children group trees.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupTree

public GroupTree(java.lang.String name)
Creates a new group tree with no operators and children.


GroupTree

public GroupTree(GroupTree other)
Clone constructor. The parent will be automatically set after this tree is added to another.

Method Detail

clone

public java.lang.Object clone()
Returns a deep clone of this tree.

Overrides:
clone in class java.lang.Object

getName

public java.lang.String getName()
Returns the name of this group.


getMainGroupName

public java.lang.String getMainGroupName()
Returns the main group name, i.e. the name of the first parent group under the root.


addSubGroup

public void addSubGroup(GroupTree child)
Adds a subgroup to this group.


getSubGroup

public GroupTree getSubGroup(java.lang.String name)
Returns the subgroup with the given name.


getSubGroups

public java.util.Collection<GroupTree> getSubGroups()
Returns a set of all children group trees.


getIndexOfSubGroup

public int getIndexOfSubGroup(GroupTree child)
Returns the index of the given subgroup or -1 if the sub group is not a child of this node.


getSubGroup

public GroupTree getSubGroup(int index)
Returns the i-th sub group.


addOperatorDescription

public void addOperatorDescription(OperatorDescription description)
Adds an operator to this group.


getOperatorDescriptions

public java.util.Set<OperatorDescription> getOperatorDescriptions()
Returns all operator descriptions in this group or an empty list if this group does not contain any operators.


getAllOperatorDescriptions

public java.util.Set<OperatorDescription> getAllOperatorDescriptions()
Returns all operator in this group and recursively the operators of all children.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(GroupTree o)
Specified by:
compareTo in interface java.lang.Comparable<GroupTree>

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2001-2009 by Rapid-I