| Constructor and Description |
|---|
BlockBag()
Instantiate a new BlockBag object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Block b)
Adds a new Block to the bag.
|
List<Block> |
get(long chksum)
Returns all Blocks in the bag with a given checksum.
|
Block |
getBlock() |
int |
getBlockIndex() |
Iterator<Block> |
iterator()
Returns an iterator over the blocks in the bag, in insertion order.
|
List<Block> |
remove(Block b)
Removes the given Block, plus any blocks inserted previous to the given
Block.
|
List<Block> |
removeAll()
Removes all blocks from the bag.
|
int |
size()
Returns the number of blocks in this bag.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic void add(Block b)
b - The Block to be added.public List<Block> get(long chksum)
chksum - The checksum to matchpublic Iterator<Block> iterator()
public List<Block> remove(Block b)
b - The Block to remove.public List<Block> removeAll()
public int getBlockIndex()
public Block getBlock()
public int size()
Copyright © 2024. All rights reserved.