Class RoundCollection

java.lang.Object
edu.ntnu.idatt1002.k2g05.models.RoundCollection
All Implemented Interfaces:
Serializable

public class RoundCollection extends Object implements Serializable
Class for holding multiple rounds. An example of a roundCollection could be "group rounds", which would hold multiple MatchRound
See Also:
  • Constructor Details

    • RoundCollection

      public RoundCollection(String name)
      Constructor for creating an instance of a round collection.
      Parameters:
      name - of the round collection
    • RoundCollection

      public RoundCollection(String name, RoundType type)
      Constructor for creating an instance of a round collection. Given a name and the type of the rounds in the collection.
      Parameters:
      name - of the round collection
      type - of the round collection
  • Method Details

    • getAllRounds

      public List<Round> getAllRounds()
      Gets all the rounds in the round collection.
      Returns:
    • getRound

      public Round getRound(int index)
    • getAmountOfRounds

      public int getAmountOfRounds()
      Gets the amount of rounds in the collection
      Returns:
      amount of rounds in the collection.
    • addRound

      public boolean addRound(Round round)
      Appends the specified round to the end of the roundCollection. null is prohibited.
      Parameters:
      round - element to be appended to this collection
      Returns:
      true (as specified by Collection.add(E))
      Throws:
      NullPointerException - if the specified element is null
    • removeRound

      public boolean removeRound(Round round)
      Removes the first occurrence of a round from this collection, if it is present. If this roundCollection does not contain the round, it is unchanged. Returns true if the collection contained the specified round (or equivalently, if this list changed as a result of the call).
      Parameters:
      round - round to be removed from this roundCollection, if present
      Returns:
      true if this list contained the specified round.
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getType

      public RoundType getType()
    • setType

      public void setType(RoundType type)