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.
|
java.util.List<Block> |
get(long chksum)
Returns all Blocks in the bag with a given checksum.
|
Block |
getBlock() |
int |
getBlockIndex() |
java.util.Iterator<Block> |
iterator()
Returns an iterator over the blocks in the bag, in insertion order.
|
java.util.List<Block> |
remove(Block b)
Removes the given Block, plus any blocks inserted previous to the given
Block.
|
java.util.List<Block> |
removeAll()
Removes all blocks from the bag.
|
int |
size()
Returns the number of blocks in this bag.
|
public void add(Block b)
b
- The Block to be added.public java.util.List<Block> get(long chksum)
chksum
- The checksum to matchpublic java.util.Iterator<Block> iterator()
iterator
in interface java.lang.Iterable<Block>
public java.util.List<Block> remove(Block b)
b
- The Block to remove.public java.util.List<Block> removeAll()
public int getBlockIndex()
public Block getBlock()
public int size()
Copyright (c) 2004-2012 Oracle. All rights reserved.