## model
Class TournamentUpdater

    java.lang.Object
      model.tournament.TournamentDataModel
          model.tournament.TournamentDataModelEditor
              model.TournamentUpdater

    public class TournamentUpdater

extends TournamentDataModelEditor

TournamentUpdater is used to create a new Tournament object. When the run-method is called the tournament that is connected to the instance of this class is updated with the data in this class. A subclass of TournamentDataModelEditor.

Field Summary
`private Tournament` `TOURNAMENT`

Constructor Summary
`protected` `TournamentUpdater(Tournament tournament)` Creates a new TournamentUpdater object and links it to the tournament given as a parameter.

Method Summary
`void` `addDiscount(java.lang.String name, java.lang.String amount, boolean dominant)` An implementation of the abstract method in superclass TournamentDataModel.
`void` `editDiscount(ID discount_id, java.lang.String name, java.lang.String amount, boolean dominant)` Replaces a discount with the given ID with a new discount created from the info in the parameters.
`Discount[]` `getDiscounts()`
`protected Tournament` `getTournament()`
`void` `removeDiscount(ID discount_id)`
`void` `run()` Edits the tournament linked to this instance of class TournamentUpdater with the data in this instance.

Methods inherited from class model.tournament.TournamentDataModelEditor
`setBaseFee, setBaseFee, setDate, setDate, setDefaultCountry, setDefaultCountry, setHtml, setName, setPreregistrationOpen, setTournamentOpen`

Methods inherited from class model.tournament.TournamentDataModel
`addDiscount, getBaseFee, getDate, getDefaultCountry, getHtml, getId, getName, hasDiscountId, isPreRegistrationOpen, isTournamentOpen, setDiscounts`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TOURNAMENT

    private final transient Tournament TOURNAMENT

Constructor Detail

### TournamentUpdater

    protected TournamentUpdater(Tournament tournament)
                         throws GoException

  Creates a new TournamentUpdater object and links it to the tournament given as a parameter.

  Throws:
    `GoException`

Method Detail

### getTournament

    protected Tournament getTournament()

### addDiscount

    public void addDiscount(java.lang.String name,
                            java.lang.String amount,
                            boolean dominant)
                     throws GoIOException

  An implementation of the abstract method in superclass TournamentDataModel. Implemented here so that the method has public visibility. Creates a new Discount object from the parameters and adds it to the data structure.

  Specified by:
    `addDiscount` in class `TournamentDataModelEditor`
  Throws:
    `GoIOException`

### editDiscount

    public void editDiscount(ID discount_id,
                             java.lang.String name,
                             java.lang.String amount,
                             boolean dominant)
                      throws DiscountNotFoundException

  Replaces a discount with the given ID with a new discount created from the info in the parameters. The ID of the new Discount object is the same as the old ID.

  Throws:
    `DiscountNotFoundException` - if the discount is not found

### removeDiscount

    public void removeDiscount(ID discount_id)

  Overrides:
    `removeDiscount` in class `TournamentDataModel`

### getDiscounts

    public Discount[] getDiscounts()

  Overrides:
    `getDiscounts` in class `TournamentDataModel`

### run

    public void run()
             throws GoException

  Edits the tournament linked to this instance of class TournamentUpdater with the data in this instance.

  Specified by:
    `run` in class `TournamentDataModelEditor`
  Throws:
    `GoException`