|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.dieselpoint.parser.Node
COPYRIGHT NOTICE SOFTWARE CONTAINING TRADE SECRETS Copyright 2003 Raritan Technologies Inc. [RTI] All rights reserved. This software and documentation constitute an unpublished work and contain valuable trade secrets and proprietary information belonging to RTI. None of the foregoing material may be copied, duplicated or disclosed without the express written permission of RTI. RTI EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR ANY PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall RTI be liable for incidental, special, indirect, direct or consequential damages or loss of profits, interruption of business, or related expenses which may arise from use of software or documentation, including but not limited to those resulting from defects in software and/or documentation, or loss or inaccuracy of data of any kind.
| Constructor Summary | |
Node(Node n)
Constructor to clone a node Note: MUST setLeft(), setRight(), setParent() on the new node. |
|
Node(java.lang.String nm,
Lexer l,
int t,
int a,
int p)
Constructor which bypasses the table lookup |
|
Node(java.lang.String nm,
Lexer l,
SymbolTable st)
Constructor which performs a symbol table lookup if the symbol is not found, assume it is a word. |
|
Node(java.lang.String nm,
Node n)
Constructor to clone a node Note: MUST setLeft(), setRight(), setParent() on the new node. |
|
| Method Summary | |
void |
adjustLevel(int adjust)
adjusts the level (paranthetical) from this point down. |
Node |
applyRules(QueryRules qr,
java.lang.String field)
turns: X |
Node |
applyRules(QueryRules qr,
java.lang.String field,
java.lang.String defaultField)
|
java.lang.Object |
clone()
Clones a tree (or sub-tree) and returns the root of the new tree. |
int |
findAllFields(java.util.HashSet fields)
Looks for all fields within this subtree. |
boolean |
findField(java.lang.String field)
Looks for a field within this subtree. |
void |
getAllValues(java.util.LinkedList a)
Pull all values out of the query. |
void |
getAllValues(java.util.LinkedList a,
boolean bPrint,
boolean bReplace)
Pull all values out of the query. |
int |
getArity()
Returns the arity of this node. |
java.lang.String |
getAttributeField()
Returns the string for attributeField. |
Node |
getLeft()
Get the left child of this node. |
boolean |
getLeftPrune()
Returns the left_prune of this node. |
int |
getLevel()
Returns the depth that this node is nested within parens. |
java.lang.String |
getName()
Returns the string for the human readable name of the symbol. |
Node |
getParent()
Get the parent of this node. |
int |
getPrecedence()
Returns the precedence of this node. |
Node |
getRight()
Get the right child of this node. |
boolean |
getRightPrune()
Returns the right_prune of this node. |
java.lang.String |
getRulesValueString()
Pull all values out of the query. |
int |
getType()
Returns the type of this node. |
void |
getValues(java.util.HashSet a)
Pull all values out of the query. |
void |
getValues(java.util.HashSet a,
boolean bPrint,
boolean bReplace)
Pull all values out of the query. |
java.util.HashSet |
getWords()
Returns a HashSet containing all (unidentified) field nodes |
boolean |
hasBoolOp()
Does this tree contain a boolean operator? |
boolean |
hasIN()
Sees if the subtree contains an |
boolean |
identifyFields(java.util.HashMap fields)
Scans the tree from this point to lookup field names. |
boolean |
identifyFields(java.util.HashMap fields,
java.util.HashMap isAttributeOf)
This version also sets the isAttributeOf field. |
Node |
insertNode(Node newNode,
Node current)
Inserts a node starting at current level, then bubbles up to the proper precedence level. |
boolean |
isBoolOp()
Is this a boolean operator? |
int |
isSubtreeWrapped(java.lang.String field)
Scans the tree from this point to find a "parent" field. |
boolean |
markFields(java.util.HashMap fields)
internal method. |
boolean |
markFields(java.util.HashMap fields,
java.util.HashMap isAttributeOf)
This version also sets the isAttributeOf field. |
java.lang.String |
probeParentField()
Scans the tree from this point to find a "parent" field. |
Node |
reduceField(java.lang.String field)
|
Node |
reduceField(java.lang.String field,
Node subTree)
turns: (X |
void |
reduceParens()
reduces any extraneous parenthesis around single fields, values. |
void |
removeCharacter(char c)
ONLY do this after identifyFields() |
void |
removeCharacters(java.lang.String remove)
ONLY do this after identifyFields() |
Node |
removeField(java.lang.String field)
Removes a field from a list. |
void |
setArity(int a)
Set the arity of this node. |
void |
setAttributeField(java.lang.String n)
Sets the attributeField string. |
void |
setLeft(Node n)
Set the left child of this node. |
void |
setLevel(int l)
Sets the level or parenthesis depth . |
void |
setName(java.lang.String n)
Sets the name string. |
void |
setParent(Node n)
Set the parent of this node. |
void |
setPrecedence(int p)
Sets the precedence of this node. |
void |
setRight(Node n)
Set the right child of this node. |
void |
setType(int t)
Set the type of this node. |
java.lang.String |
toEnglishString()
|
java.lang.String |
toEnglishString(java.util.HashMap fields)
if the fields HashMap is not null it contains the fieldId -> fieldName mapping. |
java.lang.String |
toString()
Convert to a string using a preorder scan of the tree. |
java.lang.String |
toString(java.util.HashMap replace)
Convert to a string using a preorder scan of the tree. |
java.lang.String |
toTreeString()
Convert to a string using a preorder scan of the tree. |
java.lang.String |
toTreeString(int level)
|
Node |
wrapFields(java.lang.String field,
java.util.HashMap fields)
Wraps fields not in zone or field ops with |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Node(java.lang.String nm,
Lexer l,
int t,
int a,
int p)
nm - the name of the symbol.l - the level of the symbol.t - the type of the symbol.p - the precedence of the symbol.
public Node(java.lang.String nm,
Lexer l,
SymbolTable st)
l - the instance of the lexer.nm - the name of the symbol.
public Node(java.lang.String nm,
Node n)
n - the node to be clonedpublic Node(Node n)
n - the node to be cloned| Method Detail |
public java.lang.String getName()
public void setAttributeField(java.lang.String n)
public java.lang.String getAttributeField()
public void setName(java.lang.String n)
public int getLevel()
public void setLevel(int l)
public int getType()
public void setType(int t)
public int getArity()
public void setArity(int a)
public int getPrecedence()
public void setPrecedence(int p)
public boolean getLeftPrune()
public boolean getRightPrune()
public Node getParent()
public void setParent(Node n)
public Node getLeft()
public void setLeft(Node n)
public Node getRight()
public void setRight(Node n)
public boolean hasBoolOp()
public boolean isBoolOp()
public Node insertNode(Node newNode,
Node current)
public java.lang.String probeParentField()
public int isSubtreeWrapped(java.lang.String field)
public boolean identifyFields(java.util.HashMap fields)
public boolean markFields(java.util.HashMap fields)
public boolean identifyFields(java.util.HashMap fields,
java.util.HashMap isAttributeOf)
public boolean markFields(java.util.HashMap fields,
java.util.HashMap isAttributeOf)
public boolean hasIN()
public Node wrapFields(java.lang.String field,
java.util.HashMap fields)
public java.util.HashSet getWords()
public Node removeField(java.lang.String field)
public void removeCharacters(java.lang.String remove)
public void removeCharacter(char c)
public java.lang.Object clone()
public Node reduceField(java.lang.String field)
public Node reduceField(java.lang.String field,
Node subTree)
public Node applyRules(QueryRules qr,
java.lang.String field)
public Node applyRules(QueryRules qr,
java.lang.String field,
java.lang.String defaultField)
public void reduceParens()
public boolean findField(java.lang.String field)
public int findAllFields(java.util.HashSet fields)
public void adjustLevel(int adjust)
public java.lang.String getRulesValueString()
public void getAllValues(java.util.LinkedList a)
public void getAllValues(java.util.LinkedList a,
boolean bPrint,
boolean bReplace)
public void getValues(java.util.HashSet a)
public void getValues(java.util.HashSet a,
boolean bPrint,
boolean bReplace)
public java.lang.String toString()
public java.lang.String toString(java.util.HashMap replace)
public java.lang.String toTreeString()
public java.lang.String toTreeString(int level)
public java.lang.String toEnglishString()
public java.lang.String toEnglishString(java.util.HashMap fields)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||