//# 1 errors, 60 messages
//#
/*
    //#logsummarycontainer.java:1:1: class: net.sourceforge.pebble.logging.LogSummaryContainer
    //#logsummarycontainer.java:1:1: method: net.sourceforge.pebble.logging.LogSummaryContainer.net.sourceforge.pebble.logging.LogSummaryContainer__static_init
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.logging;

import net.sourceforge.pebble.domain.Blog;

import java.util.Date;
import java.util.Iterator;
import java.util.List;

/**
 * Represents a summary of a particular log.
 *
 * @author    Simon Brown
 */
public class LogSummaryContainer extends LogSummary {

  /** a collection of (nested) LogSummary instances */
  private List logSummaries;

  /**
   * Creates a new log summary associated with the given blog.
   *
   * @param blog          a Blog instance
   */
  LogSummaryContainer(Blog blog, Date date, List logSummaries) {
    super(blog, date);
    //#logsummarycontainer.java:56: method: void net.sourceforge.pebble.logging.LogSummaryContainer.net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)
    //#input(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): blog
    //#input(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): date
    //#input(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): logSummaries
    //#input(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this
    //#output(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this.blog
    //#output(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this.date
    //#output(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this.logSummaries
    //#post(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this.blog == blog
    //#post(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): init'ed(this.blog)
    //#post(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this.date == date
    //#post(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): init'ed(this.date)
    //#post(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): this.logSummaries == logSummaries
    //#post(void net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)): init'ed(this.logSummaries)
    this.logSummaries = logSummaries;
  }
    //#logsummarycontainer.java:58: end of method: void net.sourceforge.pebble.logging.LogSummaryContainer.net.sourceforge.pebble.logging.LogSummaryContainer(Blog, Date, List)

  /**
   * Gets the total number of requests.
   *
   * @return  the total number as an int
   */
  public int getTotalRequests() {
    int totalRequests = 0;
    //#logsummarycontainer.java:66: method: int net.sourceforge.pebble.logging.LogSummaryContainer.getTotalRequests()
    //#input(int getTotalRequests()): __Dispatch_Table.getTotalRequests()I
    //#input(int getTotalRequests()): net/sourceforge/pebble/logging/LogSummary.__Descendant_Table[net/sourceforge/pebble/logging/LogSummaryContainer]
    //#input(int getTotalRequests()): net/sourceforge/pebble/logging/LogSummary.__Descendant_Table[net/sourceforge/pebble/logging/LogSummaryItem]
    //#input(int getTotalRequests()): net/sourceforge/pebble/logging/LogSummary.__Descendant_Table[net/sourceforge/pebble/logging/LogSummary]
    //#input(int getTotalRequests()): net/sourceforge/pebble/logging/LogSummary.__Descendant_Table[others]
    //#input(int getTotalRequests()): net/sourceforge/pebble/logging/LogSummary.__Dispatch_Table.getTotalRequests()I
    //#input(int getTotalRequests()): net/sourceforge/pebble/logging/LogSummaryItem.__Dispatch_Table.getTotalRequests()I
    //#input(int getTotalRequests()): this
    //#input(int getTotalRequests()): this.logSummaries
    //#output(int getTotalRequests()): return_value
    //#pre[2] (int getTotalRequests()): this.logSummaries != null
    //#presumption(int getTotalRequests()): java.util.Iterator:next(...).__Tag@69 in {net/sourceforge/pebble/logging/LogSummary, net/sourceforge/pebble/logging/LogSummaryContainer, net/sourceforge/pebble/logging/LogSummaryItem}
    //#presumption(int getTotalRequests()): java.util.Iterator:next(...)@69 != null
    //#post(int getTotalRequests()): init'ed(return_value)
    //#unanalyzed(int getTotalRequests()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(int getTotalRequests()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(int getTotalRequests()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(int getTotalRequests()): Effects-of-calling:getTotalRequests
    //#test_vector(int getTotalRequests()): java.util.Iterator:hasNext(...)@68: {1}, {0}
    Iterator it = logSummaries.iterator();
    while (it.hasNext()) {
      totalRequests += ((LogSummary)it.next()).getTotalRequests();
    //#logsummarycontainer.java:69: Warning: method not available
    //#    -- call on int getTotalRequests()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.logging.LogSummaryContainer
    //#    method: int getTotalRequests()
    //#    unanalyzed callee: int getTotalRequests()
    //#logsummarycontainer.java:69: ?overflow
    //#    totalRequests + getTotalRequests(...) in -2_147_483_648..4_294_967_295
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.logging.LogSummaryContainer
    //#    method: int getTotalRequests()
    //#    basic block: bb_5
    //#    assertion: totalRequests + getTotalRequests(...) in -2_147_483_648..4_294_967_295
    //#    VN: totalRequests + getTotalRequests(...)
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {-4_294_967_296..-2_147_483_649, 4_294_967_296..8_589_934_590}
    //#    Attribs:  Int  Bad < Exp  Bad > Exp
    }

    return totalRequests;
    //#logsummarycontainer.java:72: end of method: int net.sourceforge.pebble.logging.LogSummaryContainer.getTotalRequests()
  }

  /**
   * Gets a collection of all nested LogSummary objects.
   *
   * @return    a List of LogSummary instances
   */
  public List getLogSummaries() {
    return this.logSummaries;
    //#logsummarycontainer.java:81: method: List net.sourceforge.pebble.logging.LogSummaryContainer.getLogSummaries()
    //#input(List getLogSummaries()): this
    //#input(List getLogSummaries()): this.logSummaries
    //#output(List getLogSummaries()): return_value
    //#pre[2] (List getLogSummaries()): init'ed(this.logSummaries)
    //#post(List getLogSummaries()): return_value == this.logSummaries
    //#post(List getLogSummaries()): init'ed(return_value)
    //#logsummarycontainer.java:81: end of method: List net.sourceforge.pebble.logging.LogSummaryContainer.getLogSummaries()
  }

}
    //#output(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Descendant_Table[net/sourceforge/pebble/logging/LogSummaryContainer]
    //#output(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Dispatch_Table.getDate()Ljava/util/Date;
    //#output(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Dispatch_Table.getLogSummaries()Ljava/util/List;
    //#output(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Dispatch_Table.getTotalRequests()I
    //#output(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): net/sourceforge/pebble/logging/LogSummary.__Descendant_Table[net/sourceforge/pebble/logging/LogSummaryContainer]
    //#post(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Descendant_Table[net/sourceforge/pebble/logging/LogSummaryContainer] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): net/sourceforge/pebble/logging/LogSummary.__Descendant_Table[net/sourceforge/pebble/logging/LogSummaryContainer] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Dispatch_Table.getDate()Ljava/util/Date; == &net/sourceforge/pebble/logging/LogSummary.getDate
    //#post(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Dispatch_Table.getLogSummaries()Ljava/util/List; == &getLogSummaries
    //#post(net.sourceforge.pebble.logging.LogSummaryContainer__static_init): __Dispatch_Table.getTotalRequests()I == &getTotalRequests
    //#logsummarycontainer.java:: end of method: net.sourceforge.pebble.logging.LogSummaryContainer.net.sourceforge.pebble.logging.LogSummaryContainer__static_init
    //#logsummarycontainer.java:: end of class: net.sourceforge.pebble.logging.LogSummaryContainer
