public class XBTTreeNode extends java.lang.Object implements javax.swing.tree.TreeNode, XBTEditableBlock, UBStreamable, XBTRConversible
| Modifier and Type | Class and Description |
|---|---|
class |
XBTTreeNode.XBParamExtractor
Class for extracting specified param from tokens
|
| Constructor and Description |
|---|
XBTTreeNode()
Creates a new instance of XBTTreeNode
|
XBTTreeNode(XBTTreeNode parent)
Creates a new instance of XBTTreeNode.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(UBNatural attribute) |
int |
attrSizeUB() |
void |
clearAttributes() |
XBTTreeNode |
clone() |
XBTTreeNode |
clone(boolean recursive) |
XBTListener |
convertFromXBT()
Get instance for conversion content from XB level 1 data to object.
|
XBTListener |
convertFromXBTR(boolean recursive)
Get instance for conversion content from XB level 1 data to object.
|
XBTProvider |
convertToXBT()
Get instance for conversion content of object to XB level 1 data.
|
XBTProvider |
convertToXBTR(boolean recursive)
Get instance for conversion content of object to XB level 1 data.
|
XBTTreeNode |
findNodeByIndex(long index)
Find Node on given depth-first order index (recursive, no cache)
|
XBTTreeNode |
followPointer(int index) |
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
|
int |
getAttrValue(int index) |
int |
getBlockIndex()
Get index in depth-first order
|
long |
getBlockSize()
Get block size
|
XBBlockType |
getBlockType()
Get block type.
|
java.io.InputStream |
getData()
Get node data
|
byte[] |
getDataArray() |
int |
getDataSize()
Get data size
|
XBTTreeNode |
getChildAt(int childIndex)
Get children of given index
|
int |
getChildCount()
Get count of children
|
java.util.List<XBTBlock> |
getChildren()
Get list of all children
|
int |
getIndex(javax.swing.tree.TreeNode node)
Return index of child
|
int |
getNodeIndexAfter() |
XBTBlock |
getParam(XBACatalog catalog,
long paramId) |
XBTConversible |
getParameter(int index)
Get specific parameter convertor from current block.
|
XBTTreeNode |
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)
Reads all children blocks.
|
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.
|
XBTTreeNode |
newNodeInstance(XBTTreeNode parent)
TODO: This is stub, because I'm to lazy to think about proper solution
|
void |
processSpec(XBCatalog catalog,
XBContext parentContext)
Performs tree depth specification processing
|
void |
removeAttribute(int index) |
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 |
setBlockType(XBBlockType blockType) |
void |
setData(java.io.InputStream source)
Set node data
|
void |
setDataNode(boolean dataNode)
Set data node
|
void |
setChildAt(XBTBlock block,
int childIndex)
Set children of given index
|
void |
setChildCount(int count)
Get count of children
|
void |
setChildren(java.util.List<XBTBlock> children)
Set list of all children
|
void |
setParent(XBTBlock 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() |
void |
toXBTEvents(XBTListener target) |
void |
toXBTEvents(XBTListener target,
boolean recursive) |
public XBTTreeNode()
public XBTTreeNode(XBTTreeNode parent)
parent - Set it as parent nodepublic void processSpec(XBCatalog catalog, XBContext parentContext)
public XBTTreeNode followPointer(int index)
public int getAttrValue(int index)
public int childrenFromStreamUB(java.io.InputStream stream,
int maxSize)
throws java.io.IOException,
XBProcessingException
stream - Source input streammaxSize - Maximum size of bytes to consume. Otherwise Exception.java.io.IOExceptionXBProcessingExceptionpublic void toXBTEvents(XBTListener target, boolean recursive) throws XBProcessingException, java.io.IOException
XBProcessingExceptionjava.io.IOExceptionpublic void toXBTEvents(XBTListener target) throws XBProcessingException, java.io.IOException
XBProcessingExceptionjava.io.IOExceptionpublic XBBlockType getBlockType()
XBTBlockgetBlockType in interface XBTBlockpublic XBTTreeNode getParent()
XBTBlockpublic XBTTreeNode getChildAt(int childIndex)
XBTBlockgetChildAt in interface javax.swing.tree.TreeNodegetChildAt in interface XBTBlockpublic int getChildCount()
XBTBlockgetChildCount in interface javax.swing.tree.TreeNodegetChildCount in interface XBTBlockpublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodepublic int getSubNodesCount()
public int getBlockIndex()
getBlockIndex in interface XBTBlockpublic int getNodeIndexAfter()
public XBTTreeNode 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 sizeUB()
UBStreamablesizeUB in interface UBStreamablepublic int childrenSizeUB()
public int attrSizeUB()
public java.util.List<UBNatural> getAttributes()
XBTBlockgetAttributes in interface XBTBlockpublic void setAttributes(java.util.List<UBNatural> attributes)
XBTEditableBlocksetAttributes in interface XBTEditableBlockpublic boolean isDataNode()
XBTBlockisDataNode in interface XBTBlockpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getAttributesCount()
XBTBlockgetAttributesCount in interface XBTBlockpublic UBNatural getAttribute(int index)
XBTBlockgetAttribute in interface XBTBlockpublic java.util.List<XBTBlock> getChildren()
XBTBlockgetChildren in interface XBTBlockpublic void setChildren(java.util.List<XBTBlock> children)
XBTEditableBlocksetChildren in interface XBTEditableBlockpublic void setParent(XBTBlock parent)
XBTEditableBlocksetParent in interface XBTEditableBlockpublic void setData(java.io.InputStream source)
XBTEditableBlocksetData in interface XBTEditableBlockpublic java.io.InputStream getData()
XBTBlockpublic byte[] getDataArray()
public int getDataSize()
XBTBlockgetDataSize in interface XBTBlockpublic boolean isTerminated()
XBTBlockisTerminated in interface XBTBlockpublic void setTerminated(boolean terminated)
XBTEditableBlocksetTerminated in interface XBTEditableBlockpublic XBTTreeNode clone()
clone in class java.lang.Objectpublic XBTTreeNode clone(boolean recursive)
public XBTProvider convertToXBTR(boolean recursive)
XBTRConversibleconvertToXBTR in interface XBTRConversiblerecursive - flag whether instance shall support full or shallow conversionpublic XBTListener convertFromXBTR(boolean recursive)
XBTRConversibleconvertFromXBTR in interface XBTRConversiblerecursive - flag whether instance shall support full or shallow conversionpublic XBTProvider convertToXBT()
XBTConversibleconvertToXBT in interface XBTConversiblepublic XBTListener convertFromXBT()
XBTConversibleconvertFromXBT in interface XBTConversiblepublic void setDataNode(boolean dataNode)
XBTEditableBlocksetDataNode in interface XBTEditableBlockpublic void setAttributesCount(int count)
XBTEditableBlocksetAttributesCount in interface XBTEditableBlockpublic void setAttribute(UBNatural attribute, int index)
XBTEditableBlocksetAttribute in interface XBTEditableBlockpublic void setChildCount(int count)
XBTEditableBlocksetChildCount in interface XBTEditableBlockpublic void setChildAt(XBTBlock block, int childIndex)
XBTEditableBlocksetChildAt in interface XBTEditableBlockpublic XBTTreeNode newNodeInstance(XBTTreeNode parent)
public long getBlockSize()
XBTBlockgetBlockSize in interface XBTBlockpublic void setBlockType(XBBlockType blockType)
blockType - the blockType to setpublic void clearAttributes()
public void addAttribute(UBNatural attribute)
public void removeAttribute(int index)
public XBTConversible getParameter(int index)
index - index of requested parameterpublic XBTBlock getParam(XBACatalog catalog, long paramId)