Package org.exbin.xbup.core.block
Class XBTEmptyBlock
- java.lang.Object
-
- org.exbin.xbup.core.block.XBTEmptyBlock
-
- All Implemented Interfaces:
XBTBlock
,XBPSequenceSerializable
,XBSerializable
public class XBTEmptyBlock extends java.lang.Object implements XBTBlock, XBPSequenceSerializable
Read-only empty level 1 block.
-
-
Constructor Summary
Constructors Constructor Description XBTEmptyBlock()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UBNatural
getAttributeAt(int attributeIndex)
Gets attribute of given index.XBAttribute[]
getAttributes()
Gets array of attributes in order of appearance.int
getAttributesCount()
Gets count of attributes.org.exbin.auxiliary.paged_data.BinaryData
getBlockData()
Gets block data.XBBlockType
getBlockType()
Gets block type.java.io.InputStream
getData()
Gets block data.XBBlockDataMode
getDataMode()
Returns whether this block is data block.static XBTEmptyBlock
getEmptyBlock()
XBTBlock
getChildAt(int childIndex)
Gets children of given index.XBTBlock[]
getChildren()
Gets array of all children.int
getChildrenCount()
Gets count of children blocks.java.util.Optional<XBTBlock>
getParentBlock()
Gets parent block or null if block has no parent.XBBlockTerminationMode
getTerminationMode()
Returns whether this block is using sequence of children ended with termination block.void
serializeXB(XBPSequenceSerialHandler serializationHandler)
Performs dual-way serialization to XBUP protocol.
-
-
-
Method Detail
-
getParentBlock
@Nonnull public java.util.Optional<XBTBlock> getParentBlock()
Description copied from interface:XBTBlock
Gets parent block or null if block has no parent.- Specified by:
getParentBlock
in interfaceXBTBlock
- Returns:
- parent block
-
getTerminationMode
public XBBlockTerminationMode getTerminationMode()
Description copied from interface:XBTBlock
Returns whether this block is using sequence of children ended with termination block.- Specified by:
getTerminationMode
in interfaceXBTBlock
- Returns:
- terminated mode
-
getDataMode
public XBBlockDataMode getDataMode()
Description copied from interface:XBTBlock
Returns whether this block is data block.- Specified by:
getDataMode
in interfaceXBTBlock
- Returns:
- data mode
-
getBlockType
public XBBlockType getBlockType()
Description copied from interface:XBTBlock
Gets block type.- Specified by:
getBlockType
in interfaceXBTBlock
- Returns:
- block type
-
getAttributes
public XBAttribute[] getAttributes()
Description copied from interface:XBTBlock
Gets array of attributes in order of appearance.- Specified by:
getAttributes
in interfaceXBTBlock
- Returns:
- array of attributes
-
getAttributeAt
public UBNatural getAttributeAt(int attributeIndex)
Description copied from interface:XBTBlock
Gets attribute of given index. Returns zero if attribute index greater than attributes count.- Specified by:
getAttributeAt
in interfaceXBTBlock
- Parameters:
attributeIndex
- index of attribute- Returns:
- attribute value
-
getAttributesCount
public int getAttributesCount()
Description copied from interface:XBTBlock
Gets count of attributes.- Specified by:
getAttributesCount
in interfaceXBTBlock
- Returns:
- count of attributes
-
getChildren
public XBTBlock[] getChildren()
Description copied from interface:XBTBlock
Gets array of all children.- Specified by:
getChildren
in interfaceXBTBlock
- Returns:
- array of child blocks
-
getChildAt
public XBTBlock getChildAt(int childIndex)
Description copied from interface:XBTBlock
Gets children of given index. If no child for given index exist, return null.- Specified by:
getChildAt
in interfaceXBTBlock
- Parameters:
childIndex
- index of child block- Returns:
- child block
-
getChildrenCount
public int getChildrenCount()
Description copied from interface:XBTBlock
Gets count of children blocks.- Specified by:
getChildrenCount
in interfaceXBTBlock
- Returns:
- count of children
-
getData
@Nonnull public java.io.InputStream getData()
Description copied from interface:XBTBlock
Gets block data.
-
getBlockData
@Nonnull public org.exbin.auxiliary.paged_data.BinaryData getBlockData()
Description copied from interface:XBTBlock
Gets block data.- Specified by:
getBlockData
in interfaceXBTBlock
- Returns:
- block data or throws invalid operation on non-data block
-
getEmptyBlock
public static XBTEmptyBlock getEmptyBlock()
-
serializeXB
public void serializeXB(XBPSequenceSerialHandler serializationHandler) throws XBProcessingException, java.io.IOException
Description copied from interface:XBPSequenceSerializable
Performs dual-way serialization to XBUP protocol.- Specified by:
serializeXB
in interfaceXBPSequenceSerializable
- Parameters:
serializationHandler
- serialization resource- Throws:
XBProcessingException
- if proccesing problem encounteredjava.io.IOException
- if input/output problem encountered
-
-