Class 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 subset
      breitband.preset.ImmutableList<java.lang.String> shuffle()
      Shuffles the contract pool and returns a subset of all contract IDs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 Contracts
        subsetSize - 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