Package org.exbin.xbup.core.block
Class XBEmptyBlock
- java.lang.Object
-
- org.exbin.xbup.core.block.XBEmptyBlock
-
- All Implemented Interfaces:
XBBlock,XBPSequenceSerializable,XBSerializable
@ParametersAreNonnullByDefault public class XBEmptyBlock extends java.lang.Object implements XBBlock, XBPSequenceSerializable
Read-only empty level 0 block.
-
-
Constructor Summary
Constructors Constructor Description XBEmptyBlock()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UBNaturalgetAttributeAt(int attributeIndex)Gets attribute of given index / order.XBAttribute[]getAttributes()Gets array of attributes in order of appearance.intgetAttributesCount()Gets count of attributes.org.exbin.auxiliary.paged_data.BinaryDatagetBlockData()Gets block data.java.io.InputStreamgetData()Gets block data.XBBlockDataModegetDataMode()Returns mode whether this block is data block.static XBEmptyBlockgetEmptyBlock()XBBlockgetChildAt(int childIndex)Gets child block of given index.XBBlock[]getChildren()Gets array of all children blocks.intgetChildrenCount()Gets count of children.java.util.Optional<XBBlock>getParentBlock()Gets parent block or empty if block has no parent.XBBlockTerminationModegetTerminationMode()Returns whether this block is using sequence of children ended with termination block.voidserializeXB(XBPSequenceSerialHandler serializationHandler)Performs dual-way serialization to XBUP protocol.
-
-
-
Method Detail
-
getParentBlock
@Nonnull public java.util.Optional<XBBlock> getParentBlock()
Description copied from interface:XBBlockGets parent block or empty if block has no parent.- Specified by:
getParentBlockin interfaceXBBlock- Returns:
- Parent block.
-
getTerminationMode
@Nonnull public XBBlockTerminationMode getTerminationMode()
Description copied from interface:XBBlockReturns whether this block is using sequence of children ended with termination block.- Specified by:
getTerminationModein interfaceXBBlock- Returns:
- termination mode
-
getDataMode
@Nonnull public XBBlockDataMode getDataMode()
Description copied from interface:XBBlockReturns mode whether this block is data block.- Specified by:
getDataModein interfaceXBBlock- Returns:
- data mode
-
getAttributes
@Nullable public XBAttribute[] getAttributes()
Description copied from interface:XBBlockGets array of attributes in order of appearance.- Specified by:
getAttributesin interfaceXBBlock- Returns:
- array of attributes
-
getAttributeAt
@Nullable public UBNatural getAttributeAt(int attributeIndex)
Description copied from interface:XBBlockGets attribute of given index / order.- Specified by:
getAttributeAtin interfaceXBBlock- Parameters:
attributeIndex- index/order of attribute- Returns:
- attribute value
-
getAttributesCount
public int getAttributesCount()
Description copied from interface:XBBlockGets count of attributes.- Specified by:
getAttributesCountin interfaceXBBlock- Returns:
- count of attributes
-
getChildren
@Nullable public XBBlock[] getChildren()
Description copied from interface:XBBlockGets array of all children blocks.- Specified by:
getChildrenin interfaceXBBlock- Returns:
- list of child blocks
-
getChildAt
@Nullable public XBBlock getChildAt(int childIndex)
Description copied from interface:XBBlockGets child block of given index.- Specified by:
getChildAtin interfaceXBBlock- Parameters:
childIndex- index of child block- Returns:
- child block
-
getChildrenCount
public int getChildrenCount()
Description copied from interface:XBBlockGets count of children.- Specified by:
getChildrenCountin interfaceXBBlock- Returns:
- count of children
-
getData
@Nonnull public java.io.InputStream getData()
Description copied from interface:XBBlockGets block data.
-
getBlockData
@Nonnull public org.exbin.auxiliary.paged_data.BinaryData getBlockData()
Description copied from interface:XBBlockGets block data.- Specified by:
getBlockDatain interfaceXBBlock- Returns:
- block data or throws invalid operation on non-data block
-
getEmptyBlock
@Nonnull public static XBEmptyBlock getEmptyBlock()
-
serializeXB
public void serializeXB(@Nonnull XBPSequenceSerialHandler serializationHandler) throws XBProcessingException, java.io.IOExceptionDescription copied from interface:XBPSequenceSerializablePerforms dual-way serialization to XBUP protocol.- Specified by:
serializeXBin interfaceXBPSequenceSerializable- Parameters:
serializationHandler- serialization resource- Throws:
XBProcessingException- if proccesing problem encounteredjava.io.IOException- if input/output problem encountered
-
-