Class for calculating the priority principle for contracts