Package edu.ntnu.idatt1002.k2g05.models
Class RoundCollection
java.lang.Object
edu.ntnu.idatt1002.k2g05.models.RoundCollection
- All Implemented Interfaces:
Serializable
Class for holding multiple rounds. An example of a roundCollection could be "group rounds", which would hold multiple
MatchRound
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRoundCollection
(String name) Constructor for creating an instance of a round collection.RoundCollection
(String name, RoundType type) Constructor for creating an instance of a round collection. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Appends the specified round to the end of the roundCollection.Gets all the rounds in the round collection.int
Gets the amount of rounds in the collectiongetName()
getRound
(int index) getType()
boolean
removeRound
(Round round) Removes the first occurrence of a round from this collection, if it is present.void
void
toString()
-
Constructor Details
-
RoundCollection
Constructor for creating an instance of a round collection.- Parameters:
name
- of the round collection
-
RoundCollection
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 collectiontype
- of the round collection
-
-
Method Details
-
getAllRounds
Gets all the rounds in the round collection.- Returns:
-
getRound
-
getAmountOfRounds
public int getAmountOfRounds()Gets the amount of rounds in the collection- Returns:
- amount of rounds in the collection.
-
addRound
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 byCollection.add(E)
)- Throws:
NullPointerException
- if the specified element is null
-
removeRound
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. Returnstrue
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
-
setName
-
toString
-
getType
-
setType
-