|
Style Intelligence v12.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinetsoft.uql.XNode
public class XNode
All query results are represented as a tree. A result tree is consisted of hierarchy of XNode objects. Each node has a name and a value. A non-leaf node has a list of children nodes. The XNode is the base class for all other node classes.
| Field Summary | |
|---|---|
protected Object |
value
|
| Constructor Summary | |
|---|---|
XNode()
Create an empty node. |
|
XNode(String name)
Create an empty node with the specified name. |
|
| Method Summary | |
|---|---|
void |
addChild(XNode child)
Add a child to this node. |
void |
addChild(XNode child,
boolean sorted)
Add a child to this node. |
void |
addChild(XNode child,
boolean sorted,
boolean uniq)
Add a child to this node. |
int |
addr()
Get the address of this node. |
protected XNode |
checkDuplicate(XNode child)
This method is used to check if a child already exist with the same name. |
Object |
clone()
Clone the object. |
protected void |
cloneValue(XNode node)
Clone node value when necessary, do nothing by default. |
int |
compareTo(Object obj)
Compares this object with the specified object for order. |
boolean |
eq(Object obj)
Check if equals another object in content. |
boolean |
equals(Object obj)
Compare if two nodes are equal. |
Object |
getAttribute(Object key)
Get a node attribute value. |
Enumeration |
getAttributeNames()
Get all attribute names. |
XNode |
getChild(int idx)
Get the specified child node. |
XNode |
getChild(String name)
Get the child node of this node with the specified name. |
int |
getChildCount()
Get the number of children under this node. |
int |
getChildIndex(XNode child)
Find the index of the child in this node. |
Format |
getDefaultFormat()
Get the default format. |
String |
getName()
Get the node name. |
XNode |
getNode(String path)
Find the node specified by the node path. |
XNode |
getParent()
Get the parent of this node. |
String |
getPath()
Get the full path of this node. |
String |
getPath(XNode root)
Get the full path of this node. |
Object |
getValue()
Get the node value. |
Object |
getValue(String path)
Get the value of a node. |
int |
hashCode()
Calculate hash code of a node. |
void |
insertChild(int idx,
XNode child)
Insert a child to this node at the specified position. |
boolean |
isAncestor(XNode node)
Check if this node is the ancestor of another node. |
void |
removeAllChildren()
Remove all child in the tree. |
void |
removeChild(int idx)
Remove the specified child. |
void |
removeChild(int idx,
boolean permanent)
Remove the specified child. |
void |
removeChild(XNode child)
Remove the specified child. |
void |
removeChild(XNode child,
boolean permanent)
Remove the specified child. |
void |
setAttribute(Object key,
Object val)
Define an attribute and its value. |
void |
setChild(int idx,
XNode child)
Set the specified child of this node to the new child. |
void |
setDefaultFormat(Format format)
Set the default format. |
void |
setName(String name)
Set the node name. |
void |
setValue(Object value)
Set the node value. |
void |
sort(boolean ascending)
Sorts the children of this node by their names in the specified order. |
void |
sort(boolean ascending,
boolean ignoreCase)
Sorts the children of this node by their names in the specified order. |
String |
toString()
|
void |
writeXML(PrintWriter writer)
Write the node XML representation. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Object value
| Constructor Detail |
|---|
public XNode()
public XNode(String name)
name - node name.| Method Detail |
|---|
public Object getValue(String path)
path - node path.
public XNode getNode(String path)
public String getPath()
public String getPath(XNode root)
root - root is the root node of the tree. This can be used
to get the path of a node in a subtree, which has a root that
is a child of another node on the original tree.public String getName()
public void setName(String name)
public void setValue(Object value)
public Object getValue()
public Object getAttribute(Object key)
key - attribute key.
public void setAttribute(Object key,
Object val)
key - attribute key.val - attribute value.public Enumeration getAttributeNames()
public int getChildCount()
public XNode getChild(int idx)
idx - child index.
public XNode getChild(String name)
public int getChildIndex(XNode child)
public void addChild(XNode child)
public void addChild(XNode child,
boolean sorted)
child - child node.sorted - true to add child in sorted order.
public void addChild(XNode child,
boolean sorted,
boolean uniq)
child - child node.sorted - true to add child in sorted order.uniq - true to ensure the new child is unique. If child with same
same exists, create a sequence node and add all nodes with same name
to the sequence node.protected XNode checkDuplicate(XNode child)
public void setChild(int idx,
XNode child)
public void removeChild(XNode child)
public void removeChild(XNode child,
boolean permanent)
permanent - true if the caller intends to remove the child
permanently. Setting this parameter to true will remove
all references to the child's parent and the child's children.public void removeChild(int idx)
idx - the index of the child to remove
public void removeChild(int idx,
boolean permanent)
idx - the index of the child to removepermanent - true if the caller intends to remove the child
permanently. Setting this parameter to true will remove
all references to the child's parent and the child's children.public void removeAllChildren()
public void insertChild(int idx,
XNode child)
public XNode getParent()
public boolean isAncestor(XNode node)
node - the specified node.
public void writeXML(PrintWriter writer)
public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int addr()
public boolean eq(Object obj)
public Object clone()
clone in class Objectprotected void cloneValue(XNode node)
public int compareTo(Object obj)
compareTo in interface Comparableobj - the object with which to compare.
public void sort(boolean ascending,
boolean ignoreCase)
ascending - true to sort the children in ascending
order; false to sort the children in
descending order.public void sort(boolean ascending)
ascending - true to sort the children in ascending
order; false to sort the children in
descending order.public Format getDefaultFormat()
public void setDefaultFormat(Format format)
|
Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||