org.drools.eclipse.editors.completion
Class Node

java.lang.Object
  extended by org.drools.eclipse.editors.completion.Node

public class Node
extends Object


Constructor Summary
Node(String name)
           
 
Method Summary
 Node addChild(Node n)
          The method will check to see if a Node with the same string token already exists.
 Node addToken(String token)
          The method will create a new Node instance and try to add it as a child node.
 void clearChildren()
           
 Node getChild(String token)
          The method will get the child matching the string token
 Collection<Node> getChildren()
           
 int getDepth()
           
 Node getParent()
           
 String getToken()
           
 boolean isMatch(Node n)
           
 boolean isMatch(String input)
          if the string matches this node's token, the method will return true.
 void removeChild(Node n)
           
 void setDepth(int depth)
           
 void setParent(Node parent)
           
 void setToken(String token)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(String name)
Method Detail

addToken

public Node addToken(String token)
The method will create a new Node instance and try to add it as a child node. If an Node with the same string token exists, the method will return the existing node instead.

Parameters:
token -
Returns:

isMatch

public boolean isMatch(String input)
if the string matches this node's token, the method will return true. Otherwise it returns false.

Parameters:
input -
Returns:

isMatch

public boolean isMatch(Node n)

addChild

public Node addChild(Node n)
The method will check to see if a Node with the same string token already exists. If it doesn't, it will add the token as a child and return the same node. On the otherhand, if there is an existing Node for the same string token, the method returns the existing Node instance.

Parameters:
n -
Returns:

removeChild

public void removeChild(Node n)

getChildren

public Collection<Node> getChildren()

getChild

public Node getChild(String token)
The method will get the child matching the string token

Parameters:
token -
Returns:

getParent

public Node getParent()

setParent

public void setParent(Node parent)

getToken

public String getToken()

setToken

public void setToken(String token)

getDepth

public int getDepth()

setDepth

public void setDepth(int depth)

clearChildren

public void clearChildren()


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.