コード例 #1
0
  @Test
  public void processTimeDivisions_PerQuarter() {
    final List<LogEntry> log = ProcessingUtils.buildLogEntries("src/test/resources/test.bbl");
    final TimeChunkProcessor processor = new TimeChunkProcessor();
    final TimeDivision firstQuarter =
        new TimeDivision(new GameTime(0, 0, 0), new GameTime(12, 0, 0), "First Quarter");
    final TimeDivision secondQuarter =
        new TimeDivision(new GameTime(12, 0, 0), new GameTime(24, 0, 0), "Second Quarter");
    final TimeDivision thirdQuarter =
        new TimeDivision(new GameTime(24, 0, 0), new GameTime(36, 0, 0), "Third Quarter");
    final TimeDivision fourthQuarter =
        new TimeDivision(new GameTime(36, 0, 0), new GameTime(48, 0, 0), "Fourth Quarter");
    final TimeDivision overtimeQuarter =
        new TimeDivision(new GameTime(48, 0, 0), new GameTime(53, 0, 0), "Overtime");

    final Map<TimeDivision, Map<Players, StatsChunk>> obj =
        processor.processTimeDivisions(
            new GameTimeChunker(new GameTime(0, 0, 0), new GameTime(100, 0, 0)),
            log,
            Arrays.asList(
                firstQuarter, secondQuarter, thirdQuarter, fourthQuarter, overtimeQuarter));
    for (final Entry<TimeDivision, Map<Players, StatsChunk>> blah : obj.entrySet()) {
      System.out.println("\n" + blah.getKey().getName());
      System.out.println(
          "NAME--------------MIN---PTS---REB---AST---STL---BLK---TO-----FG----------3PT--------FT---------FG%---3P%---FT%-OR----F-----+/----DA----DC----AFG---OFG--------O3PT----");
      for (final Entry<Players, StatsChunk> entry : blah.getValue().entrySet()) {
        System.out.println(entry.getValue().boxScore(1));
      }
    }
  }
コード例 #2
0
  @Test
  public void processTimeDivisions_FullGame() {
    // final List<LogEntry> log = ProcessingUtils.buildLogEntries("src/test/resources/test.bbl");
    final List<LogEntry> log =
        ProcessingUtils.buildLogEntries(
            "C:/Users/Anonymous/Desktop/games/basketballStats-HOME-CHICAGO_BULLS-S1-G1.bbl");
    final TimeChunkProcessor processor = new TimeChunkProcessor();
    final TimeDivision fullGame =
        new TimeDivision(new GameTime(0, 0, 0), new GameTime(60, 0, 0), "Full Game");

    final Map<TimeDivision, Map<Players, StatsChunk>> obj =
        processor.processTimeDivisions(
            new GameTimeChunker(new GameTime(0, 0, 0), new GameTime(100, 0, 0)),
            log,
            Arrays.asList(fullGame));
    System.out.println(obj);
    for (final Entry<TimeDivision, Map<Players, StatsChunk>> blah : obj.entrySet()) {
      System.out.println("\n" + blah.getKey().getName());
      System.out.println(
          "NAME--------------MIN---PTS---REB---AST---STL---BLK---TO-----FG----------3PT--------FT---------FG%---3P%---FT%-OR----F-----+/----DA----DC----AFG---OFG--------O3PT----");
      for (final Entry<Players, StatsChunk> entry : blah.getValue().entrySet()) {
        System.out.println(entry.getValue().boxScore(1));
      }
    }
  }