public class XBTreeNode extends java.lang.Object implements XBEditableBlock, javax.swing.tree.TreeNode, UBStreamable, XBRConversible
| Modifier and Type | Class and Description |
|---|---|
static class |
XBTreeNode.MyXBListener |
| Constructor and Description |
|---|
XBTreeNode()
Creates a new instance of XBTreeNode
|
XBTreeNode(XBTreeNode parent)
Creates a new instance of XBTreeNode.
|
| Modifier and Type | Method and Description |
|---|---|
int |
attrSizeUB() |
XBTreeNode |
clone() |
XBTreeNode |
clone(boolean recursive) |
XBListener |
convertFromXB()
Get instance for conversion content from XB level 1 data to object.
|
XBListener |
convertFromXBR(boolean recursive)
Get instance for conversion content from XB level 0 data to object.
|
XBProvider |
convertToXB()
Get instance for conversion content of object to XB level 0 data.
|
XBProvider |
convertToXBR(boolean recursive)
Get instance for conversion content of object to XB level 0 data.
|
XBTreeNode |
findNodeByIndex(long index)
Find Node on given depth-first order index (recursive, no cache)
|
int |
fromStreamUB(java.io.InputStream stream)
Method for reading values in UB Encoding from standard data stream.
|
int |
fromStreamUB(java.io.InputStream stream,
boolean terminable) |
boolean |
getAllowsChildren()
Returns true if the receiver allows children.
|
UBNatural |
getAttribute(int index)
Gets attribute of given index
|
java.util.List<UBNatural> |
getAttributes()
Get List of attributes in order of appearance
|
int |
getAttributesCount()
Get count of attributes
|
long |
getBlockSize()
Get block size
|
java.io.InputStream |
getData()
Get node data
|
byte[] |
getDataArray() |
int |
getDataSize()
Get data size
|
XBTreeNode |
getChildAt(int childIndex)
Get children of given index
|
int |
getChildCount()
Get count of children
|
java.util.List<XBBlock> |
getChildren()
Get list of all children
|
int |
getIndex(javax.swing.tree.TreeNode node)
Return index of child
|
int |
getNodeIndex()
Get index in depth-first order
|
int |
getNodeIndexAfter() |
XBTreeNode |
getParent()
Get parent block or null if block has no parent.
|
int |
getSubNodesCount()
Get count of all subnodes
|
java.util.Enumeration |
children() |
int |
childrenFromStreamUB(java.io.InputStream stream,
int maxSize) |
int |
childrenSizeUB() |
int |
childrenToStreamUB(java.io.OutputStream stream) |
boolean |
isDataNode()
Returns whether this block is data block.
|
boolean |
isLeaf() |
boolean |
isTerminated()
Returns whether this block is using sequence of children ended with
termination block.
|
XBTreeNode |
newNodeInstance(XBTreeNode parent)
TODO: This is stub, because I'm to lazy to think about proper solution
|
void |
setAttribute(UBNatural attribute,
int index)
Set attribute of given index
|
void |
setAttributes(java.util.List<UBNatural> attributes)
Set List of attributes in order of appearance
|
void |
setAttributesCount(int count)
Set count of attributes
|
void |
setData(java.io.InputStream source)
Set node data
|
void |
setDataNode(boolean dataNode)
Set data node
|
void |
setChildAt(XBBlock block,
int childIndex)
Set children of given index
|
void |
setChildCount(int count)
Get count of children
|
void |
setChildren(java.util.List<XBBlock> children)
Set list of all children
|
void |
setParent(XBBlock parent)
Set parent block
|
void |
setTerminated(boolean terminated)
Set terminated node
|
int |
sizeUB()
Method for reading size of data which would be saved in data stream.
|
int |
toStreamUB(java.io.OutputStream stream)
Method for writting values in UB Encoding to standard data stream.
|
java.lang.String |
toString() |
public XBTreeNode()
public XBTreeNode(XBTreeNode parent)
parent - Set it as parent nodepublic XBTreeNode getParent()
XBBlockpublic XBTreeNode getChildAt(int childIndex)
XBBlockgetChildAt in interface javax.swing.tree.TreeNodegetChildAt in interface XBBlockpublic int getChildCount()
XBBlockgetChildCount in interface javax.swing.tree.TreeNodegetChildCount in interface XBBlockpublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodepublic int getSubNodesCount()
public int getNodeIndex()
public int getNodeIndexAfter()
public XBTreeNode findNodeByIndex(long index)
public boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodepublic java.util.Enumeration children()
children in interface javax.swing.tree.TreeNodepublic int toStreamUB(java.io.OutputStream stream)
throws java.io.IOException
UBStreamabletoStreamUB in interface UBStreamablestream - Stream to writejava.io.IOExceptionpublic int fromStreamUB(java.io.InputStream stream)
throws java.io.IOException,
XBProcessingException
UBStreamablefromStreamUB in interface UBStreamablestream - Stream to readjava.io.IOExceptionXBProcessingExceptionpublic int fromStreamUB(java.io.InputStream stream,
boolean terminable)
throws java.io.IOException,
XBProcessingException
terminable - Specify if termitor can be readjava.io.IOExceptionXBProcessingExceptionpublic int childrenToStreamUB(java.io.OutputStream stream)
throws java.io.IOException
java.io.IOExceptionpublic int childrenFromStreamUB(java.io.InputStream stream,
int maxSize)
throws java.io.IOException,
XBProcessingException
maxSize - Maximum size of bytes to consume. Otherwise Exception. Zero means terminated block.java.io.IOExceptionXBProcessingExceptionpublic int sizeUB()
UBStreamablesizeUB in interface UBStreamablepublic int childrenSizeUB()
public int attrSizeUB()
public java.util.List<UBNatural> getAttributes()
XBBlockgetAttributes in interface XBBlockpublic void setAttributes(java.util.List<UBNatural> attributes)
XBEditableBlocksetAttributes in interface XBEditableBlockpublic boolean isDataNode()
XBBlockisDataNode in interface XBBlockpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getAttributesCount()
XBBlockgetAttributesCount in interface XBBlockpublic UBNatural getAttribute(int index)
XBBlockgetAttribute in interface XBBlockpublic java.util.List<XBBlock> getChildren()
XBBlockgetChildren in interface XBBlockpublic void setChildren(java.util.List<XBBlock> children)
XBEditableBlocksetChildren in interface XBEditableBlockpublic void setParent(XBBlock parent)
XBEditableBlocksetParent in interface XBEditableBlockpublic void setData(java.io.InputStream source)
XBEditableBlocksetData in interface XBEditableBlockpublic java.io.InputStream getData()
XBBlockpublic byte[] getDataArray()
public int getDataSize()
XBBlockgetDataSize in interface XBBlockpublic boolean isTerminated()
XBBlockisTerminated in interface XBBlockpublic void setTerminated(boolean terminated)
XBEditableBlocksetTerminated in interface XBEditableBlockpublic XBTreeNode clone()
clone in class java.lang.Objectpublic XBTreeNode clone(boolean recursive)
public XBProvider convertToXBR(boolean recursive)
XBRConversibleconvertToXBR in interface XBRConversiblerecursive - flag whether instance shall support full or shallow conversionpublic XBListener convertFromXBR(boolean recursive)
XBRConversibleconvertFromXBR in interface XBRConversiblerecursive - flag whether instance shall support full or shallow conversionpublic XBProvider convertToXB()
XBConversibleconvertToXB in interface XBConversiblepublic XBListener convertFromXB()
XBConversibleconvertFromXB in interface XBConversiblepublic void setDataNode(boolean dataNode)
XBEditableBlocksetDataNode in interface XBEditableBlockpublic void setAttributesCount(int count)
XBEditableBlocksetAttributesCount in interface XBEditableBlockpublic void setAttribute(UBNatural attribute, int index)
XBEditableBlocksetAttribute in interface XBEditableBlockpublic void setChildCount(int count)
XBEditableBlocksetChildCount in interface XBEditableBlockpublic void setChildAt(XBBlock block, int childIndex)
XBEditableBlocksetChildAt in interface XBEditableBlockpublic long getBlockSize()
XBBlockgetBlockSize in interface XBBlockpublic XBTreeNode newNodeInstance(XBTreeNode parent)