File Source: WeblogHitCount.java

         /* 
    P/P   *  Method: void readObject(ObjectInputStream)
          * 
          *  Preconditions:
          *    Param_1 != null
          * 
          *  Presumptions:
          *    init'ed(org.apache.openjpa.enhance.PersistenceCapable.DESERIALIZED)
          * 
          *  Postconditions:
          *    Param_0.pcDetachedState == org.apache.openjpa.enhance.PersistenceCapable.DESERIALIZED
          *    (soft) init'ed(Param_0.pcDetachedState)
          */
     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  The ASF licenses this file to You
     4   * under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.  For additional information regarding
    15   * copyright in this work, please see the NOTICE file in the top level
    16   * directory of this distribution.
    17   */
    18  
    19  package org.apache.roller.weblogger.pojos;
    20  
    21  import java.io.Serializable;
    22  import org.apache.commons.lang.builder.HashCodeBuilder;
    23  import org.apache.roller.util.UUIDGenerator;
    24  
    25  
    26  /**
    27   * Represents hit count data for a weblog.
    28   */
    29  public class WeblogHitCount implements Serializable {
    30      
    31      private String id = UUIDGenerator.generateUUID();
    32      private Weblog weblog = null;
    33      private int dailyHits = 0;
    34      
    35      
             /* 
    P/P       *  Method: void org.apache.roller.weblogger.pojos.WeblogHitCount()
              * 
              *  Postconditions:
              *    this.dailyHits == 0
              *    init'ed(this.id)
              *    this.weblog == null
              */
    36      public WeblogHitCount() {}
    37      
    38      
    39      //------------------------------------------------------- Good citizenship
    40  
    41      public String toString() {
                 /* 
    P/P           *  Method: String toString()
                  * 
                  *  Preconditions:
                  *    init'ed(this.dailyHits)
                  *    init'ed(this.id)
                  * 
                  *  Postconditions:
                  *    java.lang.StringBuffer:toString(...)._tainted == this.id._tainted
                  *    init'ed(java.lang.StringBuffer:toString(...)._tainted)
                  *    return_value == &java.lang.StringBuffer:toString(...)
                  */
    42          StringBuffer buf = new StringBuffer();
    43          buf.append("{");
    44          buf.append(this.id);
    45          buf.append(", ").append(this.dailyHits);
    46          buf.append("}");
    47          return buf.toString();
    48      }
    49      
    50      public boolean equals(Object other) {
    51          
                 /* 
    P/P           *  Method: bool equals(Object)
                  * 
                  *  Preconditions:
                  *    (soft) init'ed(other.pcStateManager)
                  *    (soft) init'ed(other.weblog)
                  *    (soft) pcInheritedFieldCount <= 232-3
                  *    (soft) init'ed(this.pcStateManager)
                  *    (soft) this.weblog != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  * 
                  *  Test Vectors:
                  *    this == other: {0}, {1}
                  */
    52          if(this == other) return true;
    53          if( !(other instanceof WeblogHitCount) ) return false;
    54          
    55          // our natural key, or business key, is our weblog
    56          final WeblogHitCount that = (WeblogHitCount) other;
    57          return this.getWeblog().equals(that.getWeblog());
    58      }
    59         
    60      public int hashCode() { 
                 /* 
    P/P           *  Method: int hashCode()
                  * 
                  *  Preconditions:
                  *    init'ed(this.pcStateManager)
                  *    init'ed(this.weblog)
                  *    (soft) pcInheritedFieldCount <= 232-3
                  * 
                  *  Presumptions:
                  *    org.apache.commons.lang.builder.HashCodeBuilder:append(...)@61 != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
    61          return new HashCodeBuilder()
    62              .append(getWeblog())
    63              .toHashCode();
    64      }
    65      
    66      
    67      public String getId() {
                 /* 
    P/P           *  Method: String pcgetId()
                  * 
                  *  Preconditions:
                  *    init'ed(this.id)
                  * 
                  *  Postconditions:
                  *    return_value == this.id
                  *    init'ed(return_value)
                  */
    68          return id;
    69      }
    70  
    71      public void setId(String id) {
                 /* 
    P/P           *  Method: void pcsetId(String)
                  * 
                  *  Postconditions:
                  *    this.id == Param_1
                  *    init'ed(this.id)
                  */
    72          this.id = id;
    73      }
    74      
    75      
    76      public Weblog getWeblog() {
                 /* 
    P/P           *  Method: Weblog pcgetWeblog()
                  * 
                  *  Preconditions:
                  *    init'ed(this.weblog)
                  * 
                  *  Postconditions:
                  *    return_value == this.weblog
                  *    init'ed(return_value)
                  */
    77          return weblog;
    78      }
    79  
    80      public void setWeblog(Weblog weblog) {
                 /* 
    P/P           *  Method: void pcsetWeblog(Weblog)
                  * 
                  *  Postconditions:
                  *    this.weblog == Param_1
                  *    init'ed(this.weblog)
                  */
    81          this.weblog = weblog;
    82      }
    83      
    84      
    85      public int getDailyHits() {
                 /* 
    P/P           *  Method: int pcgetDailyHits()
                  * 
                  *  Preconditions:
                  *    init'ed(this.dailyHits)
                  * 
                  *  Postconditions:
                  *    return_value == this.dailyHits
                  *    init'ed(return_value)
                  */
    86          return dailyHits;
    87      }
    88  
    89      public void setDailyHits(int dailyHits) {
                 /* 
    P/P           *  Method: void pcsetDailyHits(int)
                  * 
                  *  Postconditions:
                  *    this.dailyHits == Param_1
                  *    init'ed(this.dailyHits)
                  */
    90          this.dailyHits = dailyHits;
    91      }
    92      
    93  }
+   94  Other Messages








SofCheck Inspector Build Version : 2.18479
WeblogHitCount.java 2009-Jan-02 14:25:38
WeblogHitCount.class 2009-Sep-04 03:12:38