Package org.exbin.xbup.core.block
Interface XBEditableBlock
-
- All Superinterfaces:
XBBlock
- All Known Implementing Classes:
XBDefaultEditableBlock
@ParametersAreNonnullByDefault public interface XBEditableBlock extends XBBlock
Interface for editable XBUP level 0 block.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clears all data, attributes and child blocks.XBBlock
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
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 block mode.void
setChildAt(XBBlock block, int childIndex)
Sets children of given index.void
setChildren(XBBlock[] blocks)
Sets array of all children.void
setChildrenCount(int count)
Gets count of children blocks.void
setParent(XBBlock parent)
Sets parent block.void
setTerminationMode(XBBlockTerminationMode terminationMode)
Sets terminated mode.-
Methods inherited from interface org.exbin.xbup.core.block.XBBlock
getAttributeAt, getAttributes, getAttributesCount, getBlockData, getData, getDataMode, getChildAt, getChildren, getChildrenCount, getParentBlock, getTerminationMode
-
-
-
-
Method Detail
-
setParent
void setParent(@Nullable XBBlock parent)
Sets parent block.- Parameters:
parent
- parent block
-
setTerminationMode
void setTerminationMode(XBBlockTerminationMode terminationMode)
Sets terminated mode.- Parameters:
terminationMode
- terminated mode flag
-
setDataMode
void setDataMode(XBBlockDataMode dataMode)
Sets data block mode.- Parameters:
dataMode
- data block 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
-
setChildren
void setChildren(@Nullable XBBlock[] blocks)
Sets array of all children.- Parameters:
blocks
- array of children blocks
-
setChildAt
void setChildAt(XBBlock 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
- index of child block
-
setChildrenCount
void setChildrenCount(int count)
Gets count of children blocks. List of children will be trimmed/extended with empty blocks.- Parameters:
count
- count of children
-
createNewChild
XBBlock createNewChild(int childIndex)
This method instantiates new child node.- Parameters:
childIndex
- child index- Returns:
- new instance of block
-
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
- exception on 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.
-
-