//# 0 errors, 172 messages
//#
/*
    //#logentry.java:1:1: class: net.sourceforge.pebble.logging.LogEntry
    //#logentry.java:1:1: method: net.sourceforge.pebble.logging.LogEntry.net.sourceforge.pebble.logging.LogEntry__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 java.util.Date;

/**
 * Represents an entry (line) in a log file.
 *
 * @author Simon Brown
 */
public class LogEntry {
    //#logentry.java:41: method: void net.sourceforge.pebble.logging.LogEntry.net.sourceforge.pebble.logging.LogEntry()
    //#input(void net.sourceforge.pebble.logging.LogEntry()): this
    //#output(void net.sourceforge.pebble.logging.LogEntry()): new Date(LogEntry#1) num objects
    //#output(void net.sourceforge.pebble.logging.LogEntry()): this.bytes
    //#output(void net.sourceforge.pebble.logging.LogEntry()): this.date
    //#output(void net.sourceforge.pebble.logging.LogEntry()): this.request
    //#output(void net.sourceforge.pebble.logging.LogEntry()): this.statusCode
    //#new obj(void net.sourceforge.pebble.logging.LogEntry()): new Date(LogEntry#1)
    //#post(void net.sourceforge.pebble.logging.LogEntry()): this.bytes == -1
    //#post(void net.sourceforge.pebble.logging.LogEntry()): this.date == &new Date(LogEntry#1)
    //#post(void net.sourceforge.pebble.logging.LogEntry()): this.request == &""
    //#post(void net.sourceforge.pebble.logging.LogEntry()): this.statusCode == 200
    //#post(void net.sourceforge.pebble.logging.LogEntry()): new Date(LogEntry#1) num objects == 1

  /** the host that made the request */
  private String host;

  /** the date the request was made */
  private Date date = new Date();

  /** the HTTP request */
  private String request = "";

  /** the HTTP status code returned */
  private int statusCode = 200;

  /** the number of bytes returned */
  private long bytes = -1;
    //#logentry.java:56: end of method: void net.sourceforge.pebble.logging.LogEntry.net.sourceforge.pebble.logging.LogEntry()

  /** the referer (if applicable) */
  private String referer;

  /** the user-agent (if applicable) */
  private String agent;

  /**
   * Gets the host (an IP address or DNS name).
   *
   * @return  the host as a String
   */
  public String getHost() {
    return host;
    //#logentry.java:70: method: String net.sourceforge.pebble.logging.LogEntry.getHost()
    //#input(String getHost()): this
    //#input(String getHost()): this.host
    //#output(String getHost()): return_value
    //#pre[2] (String getHost()): init'ed(this.host)
    //#post(String getHost()): return_value == this.host
    //#post(String getHost()): init'ed(return_value)
    //#logentry.java:70: end of method: String net.sourceforge.pebble.logging.LogEntry.getHost()
  }

  /**
   * Sets the host (an IP address or DNS name).
   *
   * @param host    the host as a String
   */
  public void setHost(String host) {
    this.host = host;
    //#logentry.java:79: method: void net.sourceforge.pebble.logging.LogEntry.setHost(String)
    //#input(void setHost(String)): host
    //#input(void setHost(String)): this
    //#output(void setHost(String)): this.host
    //#post(void setHost(String)): this.host == host
    //#post(void setHost(String)): init'ed(this.host)
  }
    //#logentry.java:80: end of method: void net.sourceforge.pebble.logging.LogEntry.setHost(String)

  /**
   * Gets the date.
   *
   * @return  a Date
   */
  public Date getDate() {
    return date;
    //#logentry.java:88: method: Date net.sourceforge.pebble.logging.LogEntry.getDate()
    //#input(Date getDate()): this
    //#input(Date getDate()): this.date
    //#output(Date getDate()): return_value
    //#pre[2] (Date getDate()): init'ed(this.date)
    //#post(Date getDate()): return_value == this.date
    //#post(Date getDate()): init'ed(return_value)
    //#logentry.java:88: end of method: Date net.sourceforge.pebble.logging.LogEntry.getDate()
  }

  /**
   * Sets the date.
   *
   * @param date    a Date instance
   */
  public void setDate(Date date) {
    this.date = date;
    //#logentry.java:97: method: void net.sourceforge.pebble.logging.LogEntry.setDate(Date)
    //#input(void setDate(Date)): date
    //#input(void setDate(Date)): this
    //#output(void setDate(Date)): this.date
    //#post(void setDate(Date)): this.date == date
    //#post(void setDate(Date)): init'ed(this.date)
  }
    //#logentry.java:98: end of method: void net.sourceforge.pebble.logging.LogEntry.setDate(Date)

  /**
   * Gets the request.
   *
   * @return  the request as a String
   */
  public String getRequest() {
    return request;
    //#logentry.java:106: method: String net.sourceforge.pebble.logging.LogEntry.getRequest()
    //#input(String getRequest()): this
    //#input(String getRequest()): this.request
    //#output(String getRequest()): return_value
    //#pre[2] (String getRequest()): init'ed(this.request)
    //#post(String getRequest()): return_value == this.request
    //#post(String getRequest()): init'ed(return_value)
    //#logentry.java:106: end of method: String net.sourceforge.pebble.logging.LogEntry.getRequest()
  }

  /**
   * Gets just the method portion of the request.
   *
   * @return  the request method as a String
   */
  public String getRequestMethod() {
    return request.substring(0, request.indexOf("/")-1);
    //#logentry.java:115: method: String net.sourceforge.pebble.logging.LogEntry.getRequestMethod()
    //#input(String getRequestMethod()): this
    //#input(String getRequestMethod()): this.request
    //#output(String getRequestMethod()): return_value
    //#pre[2] (String getRequestMethod()): this.request != null
    //#presumption(String getRequestMethod()): java.lang.String:indexOf(...)@115 >= -2_147_483_647
    //#post(String getRequestMethod()): return_value != null
    //#logentry.java:115: end of method: String net.sourceforge.pebble.logging.LogEntry.getRequestMethod()
  }

  /**
   * Gets just the URI portion of the request.
   *
   * @return  the request URI as a String
   */
  public String getRequestUri() {
    return request.substring(request.indexOf("/"));
    //#logentry.java:124: method: String net.sourceforge.pebble.logging.LogEntry.getRequestUri()
    //#input(String getRequestUri()): this
    //#input(String getRequestUri()): this.request
    //#output(String getRequestUri()): return_value
    //#pre[2] (String getRequestUri()): this.request != null
    //#post(String getRequestUri()): return_value != null
    //#logentry.java:124: end of method: String net.sourceforge.pebble.logging.LogEntry.getRequestUri()
  }

  /**
   * Sets the request.
   *
   * @param request   the HTTP request as a String
   */
  public void setRequest(String request) {
    this.request = request;
    //#logentry.java:133: method: void net.sourceforge.pebble.logging.LogEntry.setRequest(String)
    //#input(void setRequest(String)): request
    //#input(void setRequest(String)): this
    //#output(void setRequest(String)): this.request
    //#post(void setRequest(String)): this.request == request
    //#post(void setRequest(String)): init'ed(this.request)
  }
    //#logentry.java:134: end of method: void net.sourceforge.pebble.logging.LogEntry.setRequest(String)

  /**
   * Gets the HTTP status code.
   *
   * @return    the status code as an int (-1 if not set)
   */
  public int getStatusCode() {
    return statusCode;
    //#logentry.java:142: method: int net.sourceforge.pebble.logging.LogEntry.getStatusCode()
    //#input(int getStatusCode()): this
    //#input(int getStatusCode()): this.statusCode
    //#output(int getStatusCode()): return_value
    //#pre[2] (int getStatusCode()): init'ed(this.statusCode)
    //#post(int getStatusCode()): return_value == this.statusCode
    //#post(int getStatusCode()): init'ed(return_value)
    //#logentry.java:142: end of method: int net.sourceforge.pebble.logging.LogEntry.getStatusCode()
  }

  /**
   * Sets the HTTP status code.
   *
   * @param statusCode    the status code
   */
  public void setStatusCode(int statusCode) {
    this.statusCode = statusCode;
    //#logentry.java:151: method: void net.sourceforge.pebble.logging.LogEntry.setStatusCode(int)
    //#input(void setStatusCode(int)): statusCode
    //#input(void setStatusCode(int)): this
    //#output(void setStatusCode(int)): this.statusCode
    //#post(void setStatusCode(int)): this.statusCode == statusCode
    //#post(void setStatusCode(int)): init'ed(this.statusCode)
  }
    //#logentry.java:152: end of method: void net.sourceforge.pebble.logging.LogEntry.setStatusCode(int)

  /**
   * Gets the number of bytes sent.
   *
   * @return    the number of bytes as a long (-1 if not set)
   */
  public long getBytes() {
    return bytes;
    //#logentry.java:160: method: long net.sourceforge.pebble.logging.LogEntry.getBytes()
    //#input(long getBytes()): this
    //#input(long getBytes()): this.bytes
    //#output(long getBytes()): return_value
    //#pre[2] (long getBytes()): init'ed(this.bytes)
    //#post(long getBytes()): return_value == this.bytes
    //#post(long getBytes()): init'ed(return_value)
    //#logentry.java:160: end of method: long net.sourceforge.pebble.logging.LogEntry.getBytes()
  }

  /**
   * Sets the number of bytes sent.
   *
   * @param bytes   the number of bytes sent
   */
  public void setBytes(long bytes) {
    this.bytes = bytes;
    //#logentry.java:169: method: void net.sourceforge.pebble.logging.LogEntry.setBytes(long)
    //#input(void setBytes(long)): bytes
    //#input(void setBytes(long)): this
    //#output(void setBytes(long)): this.bytes
    //#post(void setBytes(long)): this.bytes == bytes
    //#post(void setBytes(long)): init'ed(this.bytes)
  }
    //#logentry.java:170: end of method: void net.sourceforge.pebble.logging.LogEntry.setBytes(long)

  /**
   * Gets the referer.
   *
   * @return  the refering URL as a String
   */
  public String getReferer() {
    return referer;
    //#logentry.java:178: method: String net.sourceforge.pebble.logging.LogEntry.getReferer()
    //#input(String getReferer()): this
    //#input(String getReferer()): this.referer
    //#output(String getReferer()): return_value
    //#pre[2] (String getReferer()): init'ed(this.referer)
    //#post(String getReferer()): return_value == this.referer
    //#post(String getReferer()): init'ed(return_value)
    //#logentry.java:178: end of method: String net.sourceforge.pebble.logging.LogEntry.getReferer()
  }

  /**
   * Sets the referer.
   *
   * @param referer   the refering URL as a String
   */
  public void setReferer(String referer) {
    this.referer = referer;
    //#logentry.java:187: method: void net.sourceforge.pebble.logging.LogEntry.setReferer(String)
    //#input(void setReferer(String)): referer
    //#input(void setReferer(String)): this
    //#output(void setReferer(String)): this.referer
    //#post(void setReferer(String)): this.referer == referer
    //#post(void setReferer(String)): init'ed(this.referer)
  }
    //#logentry.java:188: end of method: void net.sourceforge.pebble.logging.LogEntry.setReferer(String)

  /**
   * Gets the user agent (e.g. Mozilla, Internet Explorer, Safari, etc).
   *
   * @return  the user agent as a String
   */
  public String getAgent() {
    return agent;
    //#logentry.java:196: method: String net.sourceforge.pebble.logging.LogEntry.getAgent()
    //#input(String getAgent()): this
    //#input(String getAgent()): this.agent
    //#output(String getAgent()): return_value
    //#pre[2] (String getAgent()): init'ed(this.agent)
    //#post(String getAgent()): return_value == this.agent
    //#post(String getAgent()): init'ed(return_value)
    //#logentry.java:196: end of method: String net.sourceforge.pebble.logging.LogEntry.getAgent()
  }

  /**
   * Sets the user agent.
   *
   * @param agent   the user agent as a String
   */
  public void setAgent(String agent) {
    this.agent = agent;
    //#logentry.java:205: method: void net.sourceforge.pebble.logging.LogEntry.setAgent(String)
    //#input(void setAgent(String)): agent
    //#input(void setAgent(String)): this
    //#output(void setAgent(String)): this.agent
    //#post(void setAgent(String)): this.agent == agent
    //#post(void setAgent(String)): init'ed(this.agent)
  }
    //#logentry.java:206: end of method: void net.sourceforge.pebble.logging.LogEntry.setAgent(String)

}
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Descendant_Table[net/sourceforge/pebble/logging/LogEntry]
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getAgent()Ljava/lang/String;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getBytes()J
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getDate()Ljava/util/Date;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getHost()Ljava/lang/String;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getReferer()Ljava/lang/String;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getRequest()Ljava/lang/String;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getRequestMethod()Ljava/lang/String;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getRequestUri()Ljava/lang/String;
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getStatusCode()I
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setAgent(Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setBytes(J)V
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setDate(Ljava/util/Date;)V
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setHost(Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setReferer(Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setRequest(Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setStatusCode(I)V
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Descendant_Table[net/sourceforge/pebble/logging/LogEntry] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getAgent()Ljava/lang/String; == &getAgent
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getBytes()J == &getBytes
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getDate()Ljava/util/Date; == &getDate
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getHost()Ljava/lang/String; == &getHost
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getReferer()Ljava/lang/String; == &getReferer
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getRequest()Ljava/lang/String; == &getRequest
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getRequestMethod()Ljava/lang/String; == &getRequestMethod
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getRequestUri()Ljava/lang/String; == &getRequestUri
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.getStatusCode()I == &getStatusCode
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setAgent(Ljava/lang/String;)V == &setAgent
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setBytes(J)V == &setBytes
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setDate(Ljava/util/Date;)V == &setDate
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setHost(Ljava/lang/String;)V == &setHost
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setReferer(Ljava/lang/String;)V == &setReferer
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setRequest(Ljava/lang/String;)V == &setRequest
    //#post(net.sourceforge.pebble.logging.LogEntry__static_init): __Dispatch_Table.setStatusCode(I)V == &setStatusCode
    //#logentry.java:: end of method: net.sourceforge.pebble.logging.LogEntry.net.sourceforge.pebble.logging.LogEntry__static_init
    //#logentry.java:: end of class: net.sourceforge.pebble.logging.LogEntry
