Package breitband.util
Class ContractPool
- java.lang.Object
-
- breitband.util.ContractPool
-
public class ContractPool extends java.lang.Object
Class for modelling the contract pool- Author:
- Klara Schöbel
-
-
Constructor Summary
Constructors Constructor Description ContractPool(java.util.HashMap<java.lang.String,Contract> contracts, int subsetSize)
Constructs a new Contract pool with contracts and subset size
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.HashMap<java.lang.String,Contract>
getContracts()
Gets the contracts in the contract pool.int
getSubsetSize()
Gets the size of the contract pool's subsetbreitband.preset.ImmutableList<java.lang.String>
shuffle()
Shuffles the contract pool and returns a subset of all contract IDs.
-
-
-
Constructor Detail
-
ContractPool
public ContractPool(java.util.HashMap<java.lang.String,Contract> contracts, int subsetSize)
Constructs a new Contract pool with contracts and subset size- Parameters:
contracts
- Hashmap of ContractssubsetSize
- size of this subset
-
-
Method Detail
-
getSubsetSize
public int getSubsetSize()
Gets the size of the contract pool's subset- Returns:
- Size of the subset
-
getContracts
public java.util.HashMap<java.lang.String,Contract> getContracts()
Gets the contracts in the contract pool.- Returns:
- The contracts in the contract pool
-
shuffle
public breitband.preset.ImmutableList<java.lang.String> shuffle()
Shuffles the contract pool and returns a subset of all contract IDs.The subset's size is determined by the subset size of the contract pool.
- Returns:
- A random subset of all contract IDs
-
-