FTP-Server API

graphic.services.tree
Class BinTree

java.lang.Object
  |
  +--graphic.services.tree.BinTree

public class BinTree
extends Object

The class is a binary tree, that can sort objects after the toString() method, or by the TreeNodes method (after its getSortingQualifier()).


Field Summary
protected  TreeNode Root
           
 
Constructor Summary
BinTree()
           
 
Method Summary
 void insert(Object newElement)
          Inserts a new Object in the tree
 void insert(TreeNode newElement)
          Inserts the new TreeNode element into the tree
 boolean soeg(String target)
          Seeks for a String in the Tree, and returns true if found
 boolean soeg(String target, TreeNode tree)
          Seeks for a String in the Tree, and returns true if found
 LinkedList udskriv()
          Returns a sorted tree in ascending order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Root

protected TreeNode Root
Constructor Detail

BinTree

public BinTree()
Method Detail

insert

public void insert(TreeNode newElement)
Inserts the new TreeNode element into the tree

Parameters:
newElement - The new TreeNode

insert

public void insert(Object newElement)
Inserts a new Object in the tree

Parameters:
newElement - The new Element

udskriv

public LinkedList udskriv()
Returns a sorted tree in ascending order.

Returns:
trę.

soeg

public boolean soeg(String target)
Seeks for a String in the Tree, and returns true if found

Parameters:
target - element to find.
Returns:
true = found, false = not found.

soeg

public boolean soeg(String target,
                    TreeNode tree)
Seeks for a String in the Tree, and returns true if found

Parameters:
target - element to find
tree - element to start at.
Returns:
true = found, false = missing.

FTP-Server API