Package org.exbin.xbup.core.block
Interface XBTEditableBlock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clears all data, attributes and child blocks.XBTBlock
createNewChild(int childIndex)
This method instantiates new child node.void
removeAttribute(int attributeIndex)
Removes attribute on given position.void
removeChild(int childIndex)
Removes child on given position.void
setAttributeAt(XBAttribute attribute, int attributeIndex)
Sets attribute of given index.void
setAttributes(XBAttribute[] attributes)
Sets array of attributes in order of appearance.void
setAttributesCount(int count)
Sets count of attributes.void
setBlockType(XBBlockType blockType)
Sets block type.void
setData(java.io.InputStream data)
Sets block data.void
setData(org.exbin.auxiliary.paged_data.BinaryData data)
Sets block data.void
setDataMode(XBBlockDataMode dataMode)
Sets data mode.void
setChildAt(XBTBlock block, int childIndex)
Sets children of given index.void
setChildren(XBTBlock[] blocks)
Sets array of all children.void
setChildrenCount(int count)
Gets count of children.void
setParent(XBTBlock parent)
Sets parent block.void
setTerminationMode(XBBlockTerminationMode terminationMode)
Sets terminated mode.-
Methods inherited from interface org.exbin.xbup.core.block.XBTBlock
getAttributeAt, getAttributes, getAttributesCount, getBlockData, getBlockType, getData, getDataMode, getChildAt, getChildren, getChildrenCount, getParentBlock, getTerminationMode
-
-
-
-
Method Detail
-
setParent
void setParent(@Nullable XBTBlock parent)
Sets parent block.- Parameters:
parent
- block
-
setTerminationMode
void setTerminationMode(XBBlockTerminationMode terminationMode)
Sets terminated mode.- Parameters:
terminationMode
- terminated mode flag
-
setDataMode
void setDataMode(XBBlockDataMode dataMode)
Sets data mode.- Parameters:
dataMode
- data mode
-
setAttributes
void setAttributes(@Nullable XBAttribute[] attributes)
Sets array of attributes in order of appearance.- Parameters:
attributes
- array of attributes
-
setAttributeAt
void setAttributeAt(XBAttribute attribute, int attributeIndex)
Sets attribute of given index. If index is greater than current count of attributes, new zero attributes will be filled.- Parameters:
attribute
- attribute valueattributeIndex
- attribute index
-
setAttributesCount
void setAttributesCount(int count)
Sets count of attributes. List of attributes will be trimmed/extended with zero values.- Parameters:
count
- count of attributes
-
removeAttribute
void removeAttribute(int attributeIndex)
Removes attribute on given position.- Parameters:
attributeIndex
- attribute index
-
setBlockType
void setBlockType(XBBlockType blockType)
Sets block type.- Parameters:
blockType
- block type
-
setChildren
void setChildren(@Nullable XBTBlock[] blocks)
Sets array of all children.- Parameters:
blocks
- array of blocks
-
createNewChild
@Nonnull XBTBlock createNewChild(int childIndex)
This method instantiates new child node.- Parameters:
childIndex
- child index- Returns:
- new instance of block
-
setChildAt
void setChildAt(XBTBlock block, int childIndex)
Sets children of given index. If index is greater than current count of children, new empty blocks will be filled.- Parameters:
block
- child blockchildIndex
- child index
-
setChildrenCount
void setChildrenCount(int count)
Gets count of children. List of children will be trimmed/extended with empty blocks.- Parameters:
count
- count of child blocks
-
removeChild
void removeChild(int childIndex)
Removes child on given position.- Parameters:
childIndex
- child index
-
setData
void setData(@Nullable java.io.InputStream data) throws java.io.IOException
Sets block data.- Parameters:
data
- data stream- Throws:
java.io.IOException
- if input/output error
-
setData
void setData(@Nullable org.exbin.auxiliary.paged_data.BinaryData data)
Sets block data.- Parameters:
data
- data stream
-
clear
void clear()
Clears all data, attributes and child blocks.
-
-