Sha256: d41456a4cb31576cf2faac1386c82519c267f52d4d92b69d5eb1164385402304

Contents?: true

Size: 657 Bytes

Versions: 134

Compression:

Stored size: 657 Bytes

Contents

class TeamResult {

    private int wins;
    private int losses;
    private int draws;

    TeamResult() {
        wins = 0;
        losses = 0;
        draws = 0;
    }

    int getPlayed() {
        return wins + losses + draws;
    }

    int getPoints() {
        return wins * 3 + draws;
    }

    int getWins() {
        return wins;
    }

    int getLosses() {
        return losses;
    }

    int getDraws() {
        return draws;
    }

    void applyResult(final Result result) {
        switch (result) {
            case WIN: wins++; break;
            case DRAW: draws++; break;
            case LOSS: losses++; break;
        }
    }

}

Version data entries

134 entries across 134 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.179 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.178 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.177 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.176 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.175 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.174 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.173 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.172 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.171 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.170 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.169 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.167 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.166 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.165 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.164 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.163 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.162 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.161 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java
trackler-2.2.1.160 tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java