Constructor and Description |
---|
SynchronizedBlockSet(BlockSet delegate) |
SynchronizedBlockSet(BlockSet delegate,
SynchronizedRange<?> parentRange) |
Modifier and Type | Method and Description |
---|---|
int |
blockCount()
Get the total number of blocks in this block set.
|
long |
blockSize()
Get the size of a block in this set.
|
void |
clear()
Reset block presence information (may not perform actual deletion of data)
|
boolean |
isComplete()
Shortcut method to determine if all blocks are present
|
boolean |
isEmpty()
Shortcut method to determine if no blocks are present
|
boolean |
isPresent(int blockIndex)
Check if block is present.
|
long |
lastBlockSize()
Get the size of the last block in this set
|
long |
length()
Get the total length of this block set
|
public SynchronizedBlockSet(BlockSet delegate)
public SynchronizedBlockSet(BlockSet delegate, SynchronizedRange<?> parentRange)
public int blockCount()
BlockSet
blockCount
in interface BlockSet
public long length()
BlockSet
public long blockSize()
BlockSet
Note that the last block might be smaller due to truncation (i.e. when the chunk's size is not a factor of the size of a block).
blockSize
in interface BlockSet
BlockSet.lastBlockSize()
public long lastBlockSize()
BlockSet
lastBlockSize
in interface BlockSet
BlockSet.blockSize()
public boolean isPresent(int blockIndex)
BlockSet
isPresent
in interface BlockSet
blockIndex
- Index of a block in this set
(0-based, maximum value is BlockSet.blockCount()
- 1
)public boolean isComplete()
BlockSet
isComplete
in interface BlockSet
public boolean isEmpty()
BlockSet
Copyright © 2016–2021. All rights reserved.