//# 0 errors, 278 messages
//#
/*
    //#content.java:1:1: class: net.sourceforge.pebble.domain.Content$1
    //#content.java:1:1: method: net.sourceforge.pebble.domain.Content$1.net.sourceforge.pebble.domain.Content$1__static_init
    //#content.java:1:1: class: net.sourceforge.pebble.domain.Content
    //#content.java:1:1: method: net.sourceforge.pebble.domain.Content.net.sourceforge.pebble.domain.Content__static_init
    //#content.java:1: method: void net.sourceforge.pebble.domain.Content$1.net.sourceforge.pebble.domain.Content$1(Content)
    //#input(void net.sourceforge.pebble.domain.Content$1(Content)): Param_1
    //#input(void net.sourceforge.pebble.domain.Content$1(Content)): this
    //#output(void net.sourceforge.pebble.domain.Content$1(Content)): this.this$0
    //#post(void net.sourceforge.pebble.domain.Content$1(Content)): this.this$0 == Param_1
    //#post(void net.sourceforge.pebble.domain.Content$1(Content)): init'ed(this.this$0)
 * 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.domain;

import net.sourceforge.pebble.api.event.PebbleEvent;
import net.sourceforge.pebble.util.StringUtils;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Superclass for blog entries, comments and TrackBacks.
 *
 * @author    Simon Brown
 */
public abstract class Content implements Permalinkable, Cloneable, Serializable {

  /** the state of the object */
  private State state;

  /** flag to indicate whether events are enabled */
  private boolean eventsEnabled = false;

  /** the class responsible for managing property change events */
  protected transient PropertyChangeSupport propertyChangeSupport;

  /** the collection of properties that have changed since the last store */
  private transient ArrayList propertyChangeEvents;
    //#content.java:61: method: ArrayList net.sourceforge.pebble.domain.Content.access$0(Content)
    //#input(ArrayList access$0(Content)): Param_0
    //#input(ArrayList access$0(Content)): Param_0.propertyChangeEvents
    //#output(ArrayList access$0(Content)): return_value
    //#pre[1] (ArrayList access$0(Content)): Param_0 != null
    //#pre[2] (ArrayList access$0(Content)): init'ed(Param_0.propertyChangeEvents)
    //#post(ArrayList access$0(Content)): return_value == Param_0.propertyChangeEvents
    //#post(ArrayList access$0(Content)): init'ed(return_value)
    //#content.java:61: end of method: ArrayList net.sourceforge.pebble.domain.Content.access$0(Content)

  /** the collection of PebbleEvent instances that have been initiated */
  private transient List<PebbleEvent> events = new ArrayList<PebbleEvent>();

  /**
   * Default, no args constructor.
   */
  public Content() {
    //#content.java:69: method: void net.sourceforge.pebble.domain.Content.net.sourceforge.pebble.domain.Content()
    //#input(void net.sourceforge.pebble.domain.Content()): this
    //#output(void net.sourceforge.pebble.domain.Content()): new ArrayList(Content#1) num objects
    //#output(void net.sourceforge.pebble.domain.Content()): new ArrayList(Content#3) num objects
    //#output(void net.sourceforge.pebble.domain.Content()): new PropertyChangeSupport(Content#2) num objects
    //#output(void net.sourceforge.pebble.domain.Content()): this.events
    //#output(void net.sourceforge.pebble.domain.Content()): this.eventsEnabled
    //#output(void net.sourceforge.pebble.domain.Content()): this.propertyChangeEvents
    //#output(void net.sourceforge.pebble.domain.Content()): this.propertyChangeSupport
    //#new obj(void net.sourceforge.pebble.domain.Content()): new ArrayList(Content#1)
    //#new obj(void net.sourceforge.pebble.domain.Content()): new ArrayList(Content#3)
    //#new obj(void net.sourceforge.pebble.domain.Content()): new PropertyChangeSupport(Content#2)
    //#post(void net.sourceforge.pebble.domain.Content()): this.events == &new ArrayList(Content#1)
    //#post(void net.sourceforge.pebble.domain.Content()): init'ed(this.eventsEnabled)
    //#post(void net.sourceforge.pebble.domain.Content()): this.propertyChangeEvents == &new ArrayList(Content#3)
    //#post(void net.sourceforge.pebble.domain.Content()): this.propertyChangeSupport == &new PropertyChangeSupport(Content#2)
    //#post(void net.sourceforge.pebble.domain.Content()): new ArrayList(Content#1) num objects == 1
    //#post(void net.sourceforge.pebble.domain.Content()): new ArrayList(Content#3) num objects == 1
    //#post(void net.sourceforge.pebble.domain.Content()): new PropertyChangeSupport(Content#2) num objects == 1
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.propertyChangeEvents = new ArrayList();
    this.propertyChangeSupport.addPropertyChangeListener(new PropertyChangeListener() {
    //#content.java:72: end of method: void net.sourceforge.pebble.domain.Content$1.net.sourceforge.pebble.domain.Content$1(Content)
      public void propertyChange(PropertyChangeEvent event) {
        if (areEventsEnabled()) {
    //#content.java:74: method: void net.sourceforge.pebble.domain.Content$1.propertyChange(PropertyChangeEvent)
    //#content.java:74: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.domain.Content$1
    //#    method: void propertyChange(PropertyChangeEvent)
    //#    suspicious precondition index: [4]
    //#input(void propertyChange(PropertyChangeEvent)): event
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/Content]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/PageBasedContent]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/StaticPage]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Descendant_Table[others]
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Content.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.areEventsEnabled()Z
    //#input(void propertyChange(PropertyChangeEvent)): this
    //#input(void propertyChange(PropertyChangeEvent)): this.this$0
    //#input(void propertyChange(PropertyChangeEvent)): this.this$0.__Tag
    //#input(void propertyChange(PropertyChangeEvent)): this.this$0.eventsEnabled
    //#input(void propertyChange(PropertyChangeEvent)): this.this$0.propertyChangeEvents
    //#pre[3] (void propertyChange(PropertyChangeEvent)): this.this$0 != null
    //#pre[4] (void propertyChange(PropertyChangeEvent)): this.__Tag in {net/sourceforge/pebble/domain/BlogEntry, net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Content, net/sourceforge/pebble/domain/PageBasedContent, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/StaticPage, net/sourceforge/pebble/domain/TrackBack}
    //#pre[5] (void propertyChange(PropertyChangeEvent)): init'ed(this.eventsEnabled)
    //#pre[1] (void propertyChange(PropertyChangeEvent)): (soft) event != null
    //#pre[6] (void propertyChange(PropertyChangeEvent)): (soft) this.propertyChangeEvents != null
    //#test_vector(void propertyChange(PropertyChangeEvent)): this.eventsEnabled: {0}, {1}
    //#test_vector(void propertyChange(PropertyChangeEvent)): java.beans.PropertyChangeEvent:getNewValue(...)@76: Addr_Set{null}, Inverse{null}
    //#test_vector(void propertyChange(PropertyChangeEvent)): java.beans.PropertyChangeEvent:getOldValue(...)@75: Addr_Set{null}, Inverse{null}
    //#test_vector(void propertyChange(PropertyChangeEvent)): java.lang.Object:equals(...)@78: {0}, {1}
          Object oldValue = event.getOldValue();
          Object newValue = event.getNewValue();
          if ((oldValue == null && newValue == null) ||
              (oldValue != null && newValue != null && oldValue.equals(newValue))) {
            return;
          } else {
            Content.this.propertyChangeEvents.add(event);
          }
        }
      }
    //#content.java:84: end of method: void net.sourceforge.pebble.domain.Content$1.propertyChange(PropertyChangeEvent)
    });
  }
    //#content.java:86: end of method: void net.sourceforge.pebble.domain.Content.net.sourceforge.pebble.domain.Content()

  /**
   * Gets the content of this response.
   *
   * @return  a String
   */
  public abstract String getContent();

  /**
   * Gets the content of this response, truncated and without HTML tags.
   *
   * @return    the content of this response as a String
   */
  public String getTruncatedContent() {
    return StringUtils.truncate(getContent());
    //#content.java:101: method: String net.sourceforge.pebble.domain.Content.getTruncatedContent()
    //#content.java:101: Warning: method not available
    //#    -- call on String getContent()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.domain.Content
    //#    method: String getTruncatedContent()
    //#    unanalyzed callee: String getContent()
    //#content.java:101: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.util.StringUtils:truncate(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.domain.Content
    //#    method: String getTruncatedContent()
    //#    unanalyzed callee: String net.sourceforge.pebble.util.StringUtils:truncate(String)
    //#content.java:101: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.domain.Content
    //#    method: String getTruncatedContent()
    //#    suspicious precondition index: [2]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/Content]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/PageBasedContent]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/StaticPage]
    //#input(String getTruncatedContent()): __Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(String getTruncatedContent()): __Descendant_Table[others]
    //#input(String getTruncatedContent()): __Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[others]
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBody()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/Comment.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/Comment.__Descendant_Table[others]
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getBody()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/TrackBack.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/TrackBack.__Descendant_Table[others]
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getContent()Ljava/lang/String;
    //#input(String getTruncatedContent()): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getExcerpt()Ljava/lang/String;
    //#input(String getTruncatedContent()): this
    //#input(String getTruncatedContent()): this.__Tag
    //#input(String getTruncatedContent()): this.body
    //#input(String getTruncatedContent()): this.excerpt
    //#output(String getTruncatedContent()): return_value
    //#pre[2] (String getTruncatedContent()): this.__Tag in {net/sourceforge/pebble/domain/BlogEntry, net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Content, net/sourceforge/pebble/domain/PageBasedContent, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/StaticPage, net/sourceforge/pebble/domain/TrackBack}
    //#pre[3] (String getTruncatedContent()): (soft) init'ed(this.body)
    //#pre[4] (String getTruncatedContent()): (soft) init'ed(this.body)
    //#pre[5] (String getTruncatedContent()): (soft) init'ed(this.excerpt)
    //#pre[6] (String getTruncatedContent()): (soft) init'ed(this.excerpt)
    //#post(String getTruncatedContent()): init'ed(return_value)
    //#unanalyzed(String getTruncatedContent()): Effects-of-calling:java.lang.String:length
    //#content.java:101: end of method: String net.sourceforge.pebble.domain.Content.getTruncatedContent()
  }

  /**
   * Gets the state of this comment.
   *
   * @return  a State instance (APPROVED, REJECTED or PENDING)
   */
  public State getState() {
    return this.state;
    //#content.java:110: method: State net.sourceforge.pebble.domain.Content.getState()
    //#input(State getState()): this
    //#input(State getState()): this.state
    //#output(State getState()): return_value
    //#pre[2] (State getState()): init'ed(this.state)
    //#post(State getState()): return_value == this.state
    //#post(State getState()): init'ed(return_value)
    //#content.java:110: end of method: State net.sourceforge.pebble.domain.Content.getState()
  }

  /**
   * Sets the state of this comment.
   */
  void setState(State state) {
    this.state = state;
    //#content.java:117: method: void net.sourceforge.pebble.domain.Content.setState(State)
    //#input(void setState(State)): state
    //#input(void setState(State)): this
    //#output(void setState(State)): this.state
    //#post(void setState(State)): this.state == state
    //#post(void setState(State)): init'ed(this.state)
  }
    //#content.java:118: end of method: void net.sourceforge.pebble.domain.Content.setState(State)

  /**
   * Sets whether events are enabled.
   *
   * @param b   true to enable events, false otherwise
   */
  void setEventsEnabled(boolean b) {
    this.eventsEnabled = b;
    //#content.java:126: method: void net.sourceforge.pebble.domain.Content.setEventsEnabled(bool)
    //#input(void setEventsEnabled(bool)): b
    //#input(void setEventsEnabled(bool)): this
    //#output(void setEventsEnabled(bool)): this.eventsEnabled
    //#post(void setEventsEnabled(bool)): this.eventsEnabled == b
    //#post(void setEventsEnabled(bool)): init'ed(this.eventsEnabled)
  }
    //#content.java:127: end of method: void net.sourceforge.pebble.domain.Content.setEventsEnabled(bool)

  /**
   * Determines whether events are enabled.
   *
   * @return  true if events are enabled, false otherwise
   */
  boolean areEventsEnabled() {
    return this.eventsEnabled;
    //#content.java:135: method: bool net.sourceforge.pebble.domain.Content.areEventsEnabled()
    //#input(bool areEventsEnabled()): this
    //#input(bool areEventsEnabled()): this.eventsEnabled
    //#output(bool areEventsEnabled()): return_value
    //#pre[2] (bool areEventsEnabled()): init'ed(this.eventsEnabled)
    //#post(bool areEventsEnabled()): return_value == this.eventsEnabled
    //#post(bool areEventsEnabled()): init'ed(return_value)
    //#content.java:135: end of method: bool net.sourceforge.pebble.domain.Content.areEventsEnabled()
  }

  /**
   * Clears existing property change events.
   */
  public void clearPropertyChangeEvents() {
    this.propertyChangeEvents = new ArrayList();
    //#content.java:142: method: void net.sourceforge.pebble.domain.Content.clearPropertyChangeEvents()
    //#input(void clearPropertyChangeEvents()): this
    //#output(void clearPropertyChangeEvents()): new ArrayList(clearPropertyChangeEvents#1) num objects
    //#output(void clearPropertyChangeEvents()): this.propertyChangeEvents
    //#new obj(void clearPropertyChangeEvents()): new ArrayList(clearPropertyChangeEvents#1)
    //#post(void clearPropertyChangeEvents()): this.propertyChangeEvents == &new ArrayList(clearPropertyChangeEvents#1)
    //#post(void clearPropertyChangeEvents()): new ArrayList(clearPropertyChangeEvents#1) num objects == 1
  }
    //#content.java:143: end of method: void net.sourceforge.pebble.domain.Content.clearPropertyChangeEvents()

  /**
   * Determines whether this class has had properties changed since it
   * was last persisted.
   *
   * @return  true if properties have changed, false otherwise
   */
  public boolean isDirty() {
    return !propertyChangeEvents.isEmpty();
    //#content.java:152: method: bool net.sourceforge.pebble.domain.Content.isDirty()
    //#input(bool isDirty()): this
    //#input(bool isDirty()): this.propertyChangeEvents
    //#output(bool isDirty()): return_value
    //#pre[2] (bool isDirty()): this.propertyChangeEvents != null
    //#post(bool isDirty()): init'ed(return_value)
    //#content.java:152: end of method: bool net.sourceforge.pebble.domain.Content.isDirty()
  }

  /**
   * Gets the list of property change events.
   *
   * @return  a List of PropertyChangeEvent instances
   */
  public List getPropertyChangeEvents() {
    return (List)propertyChangeEvents.clone();
    //#content.java:161: method: List net.sourceforge.pebble.domain.Content.getPropertyChangeEvents()
    //#input(List getPropertyChangeEvents()): this
    //#input(List getPropertyChangeEvents()): this.propertyChangeEvents
    //#output(List getPropertyChangeEvents()): return_value
    //#pre[2] (List getPropertyChangeEvents()): this.propertyChangeEvents != null
    //#post(List getPropertyChangeEvents()): return_value != null
    //#content.java:161: end of method: List net.sourceforge.pebble.domain.Content.getPropertyChangeEvents()
  }

  /**
   * Adds an event to the list.
   *
   * @param event   a PebbleEvent instance
   */
  synchronized void addEvent(PebbleEvent event) {
    events.add(event);
    //#content.java:170: method: void net.sourceforge.pebble.domain.Content.addEvent(PebbleEvent)
    //#input(void addEvent(PebbleEvent)): event
    //#input(void addEvent(PebbleEvent)): this
    //#input(void addEvent(PebbleEvent)): this.events
    //#pre[3] (void addEvent(PebbleEvent)): this.events != null
  }
    //#content.java:171: end of method: void net.sourceforge.pebble.domain.Content.addEvent(PebbleEvent)

  /**
   * Inserts an event to the list into the front of the list.
   *
   * @param event   a PebbleEvent instance
   */
  synchronized void insertEvent(PebbleEvent event) {
    events.add(0, event);
    //#content.java:179: method: void net.sourceforge.pebble.domain.Content.insertEvent(PebbleEvent)
    //#input(void insertEvent(PebbleEvent)): event
    //#input(void insertEvent(PebbleEvent)): this
    //#input(void insertEvent(PebbleEvent)): this.events
    //#pre[3] (void insertEvent(PebbleEvent)): this.events != null
  }
    //#content.java:180: end of method: void net.sourceforge.pebble.domain.Content.insertEvent(PebbleEvent)

  /**
   * Determines whether this object has outstanding events.
   *
   * @return    true if events are outstanding, false otherwise
   */
  public synchronized boolean hasEvents() {
    return !events.isEmpty();
    //#content.java:188: method: bool net.sourceforge.pebble.domain.Content.hasEvents()
    //#input(bool hasEvents()): this
    //#input(bool hasEvents()): this.events
    //#output(bool hasEvents()): return_value
    //#pre[2] (bool hasEvents()): this.events != null
    //#post(bool hasEvents()): init'ed(return_value)
    //#content.java:188: end of method: bool net.sourceforge.pebble.domain.Content.hasEvents()
  }

  /**
   * Gets the next event to be handled.
   *
   * @return  a PebbleEvent instance, or null if no more events
   */
  public synchronized PebbleEvent nextEvent() {
    if (hasEvents()) {
    //#content.java:197: method: PebbleEvent net.sourceforge.pebble.domain.Content.nextEvent()
    //#content.java:197: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.domain.Content
    //#    method: PebbleEvent nextEvent()
    //#    suspicious precondition index: [2]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/Content]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/PageBasedContent]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/StaticPage]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(PebbleEvent nextEvent()): __Descendant_Table[others]
    //#input(PebbleEvent nextEvent()): __Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/api/event/PebbleEvent.__Descendant_Table[net/sourceforge/pebble/api/event/PebbleEvent]
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/api/event/PebbleEvent.__Descendant_Table[net/sourceforge/pebble/api/event/blog/BlogEvent]
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/api/event/PebbleEvent.__Descendant_Table[net/sourceforge/pebble/api/event/blogentry/BlogEntryEvent]
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/api/event/PebbleEvent.__Descendant_Table[net/sourceforge/pebble/api/event/comment/CommentEvent]
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/api/event/PebbleEvent.__Descendant_Table[net/sourceforge/pebble/api/event/trackback/TrackBackEvent]
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/api/event/PebbleEvent.__Descendant_Table[others]
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/domain/Response.__Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.hasEvents()Z
    //#input(PebbleEvent nextEvent()): this
    //#input(PebbleEvent nextEvent()): this.__Tag
    //#input(PebbleEvent nextEvent()): this.events
    //#output(PebbleEvent nextEvent()): return_value
    //#pre[2] (PebbleEvent nextEvent()): this.__Tag in {net/sourceforge/pebble/domain/BlogEntry, net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Content, net/sourceforge/pebble/domain/PageBasedContent, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/StaticPage, net/sourceforge/pebble/domain/TrackBack}
    //#pre[3] (PebbleEvent nextEvent()): this.events != null
    //#presumption(PebbleEvent nextEvent()): java.util.List:remove(...).__Tag@198 in {net/sourceforge/pebble/api/event/blog/BlogEvent, net/sourceforge/pebble/api/event/blogentry/BlogEntryEvent, net/sourceforge/pebble/api/event/comment/CommentEvent, net/sourceforge/pebble/api/event/PebbleEvent, net/sourceforge/pebble/api/event/trackback/TrackBackEvent}
    //#post(PebbleEvent nextEvent()): init'ed(return_value)
    //#unanalyzed(PebbleEvent nextEvent()): Effects-of-calling:java.util.List:isEmpty
      return events.remove(0);
    } else {
      return null;
    //#content.java:200: end of method: PebbleEvent net.sourceforge.pebble.domain.Content.nextEvent()
    }
  }

  synchronized void clearEvents() {
    events = new ArrayList<PebbleEvent>();
    //#content.java:205: method: void net.sourceforge.pebble.domain.Content.clearEvents()
    //#input(void clearEvents()): this
    //#output(void clearEvents()): new ArrayList(clearEvents#1) num objects
    //#output(void clearEvents()): this.events
    //#new obj(void clearEvents()): new ArrayList(clearEvents#1)
    //#post(void clearEvents()): this.events == &new ArrayList(clearEvents#1)
    //#post(void clearEvents()): new ArrayList(clearEvents#1) num objects == 1
  }
    //#content.java:206: end of method: void net.sourceforge.pebble.domain.Content.clearEvents()

  public synchronized List<PebbleEvent> getEvents() {
    return new ArrayList<PebbleEvent>(events);
    //#content.java:209: method: List net.sourceforge.pebble.domain.Content.getEvents()
    //#input(List getEvents()): this
    //#input(List getEvents()): this.events
    //#output(List getEvents()): new ArrayList(getEvents#1) num objects
    //#output(List getEvents()): return_value
    //#new obj(List getEvents()): new ArrayList(getEvents#1)
    //#pre[2] (List getEvents()): init'ed(this.events)
    //#post(List getEvents()): return_value == &new ArrayList(getEvents#1)
    //#post(List getEvents()): new ArrayList(getEvents#1) num objects == 1
    //#content.java:209: end of method: List net.sourceforge.pebble.domain.Content.getEvents()
  }

}    //#output(net.sourceforge.pebble.domain.Content$1__static_init): __Descendant_Table[net/sourceforge/pebble/domain/Content$1]
    //#output(net.sourceforge.pebble.domain.Content$1__static_init): __Dispatch_Table.propertyChange(Ljava/beans/PropertyChangeEvent;)V
    //#post(net.sourceforge.pebble.domain.Content$1__static_init): __Descendant_Table[net/sourceforge/pebble/domain/Content$1] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.domain.Content$1__static_init): __Dispatch_Table.propertyChange(Ljava/beans/PropertyChangeEvent;)V == &propertyChange
    //#content.java:: end of method: net.sourceforge.pebble.domain.Content$1.net.sourceforge.pebble.domain.Content$1__static_init
    //#content.java:: end of class: net.sourceforge.pebble.domain.Content$1
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Descendant_Table[net/sourceforge/pebble/domain/Content]
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.addEvent(Lnet/sourceforge/pebble/api/event/PebbleEvent;)V
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.areEventsEnabled()Z
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.clearEvents()V
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.clearPropertyChangeEvents()V
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getContent()Ljava/lang/String;
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getEvents()Ljava/util/List;
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getPropertyChangeEvents()Ljava/util/List;
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getState()Lnet/sourceforge/pebble/domain/State;
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getTruncatedContent()Ljava/lang/String;
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.hasEvents()Z
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.insertEvent(Lnet/sourceforge/pebble/api/event/PebbleEvent;)V
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.isDirty()Z
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.nextEvent()Lnet/sourceforge/pebble/api/event/PebbleEvent;
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.setEventsEnabled(Z)V
    //#output(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.setState(Lnet/sourceforge/pebble/domain/State;)V
    //#output(net.sourceforge.pebble.domain.Content__static_init): net/sourceforge/pebble/domain/Permalinkable.__Descendant_Table[net/sourceforge/pebble/domain/Content]
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Descendant_Table[net/sourceforge/pebble/domain/Content] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.domain.Content__static_init): net/sourceforge/pebble/domain/Permalinkable.__Descendant_Table[net/sourceforge/pebble/domain/Content] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.addEvent(Lnet/sourceforge/pebble/api/event/PebbleEvent;)V == &addEvent
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.areEventsEnabled()Z == &areEventsEnabled
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.clearEvents()V == &clearEvents
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.clearPropertyChangeEvents()V == &clearPropertyChangeEvents
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getContent()Ljava/lang/String; == &getContent
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getEvents()Ljava/util/List; == &getEvents
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getPropertyChangeEvents()Ljava/util/List; == &getPropertyChangeEvents
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getState()Lnet/sourceforge/pebble/domain/State; == &getState
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.getTruncatedContent()Ljava/lang/String; == &getTruncatedContent
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.hasEvents()Z == &hasEvents
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.insertEvent(Lnet/sourceforge/pebble/api/event/PebbleEvent;)V == &insertEvent
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.isDirty()Z == &isDirty
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.nextEvent()Lnet/sourceforge/pebble/api/event/PebbleEvent; == &nextEvent
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.setEventsEnabled(Z)V == &setEventsEnabled
    //#post(net.sourceforge.pebble.domain.Content__static_init): __Dispatch_Table.setState(Lnet/sourceforge/pebble/domain/State;)V == &setState
    //#content.java:: end of method: net.sourceforge.pebble.domain.Content.net.sourceforge.pebble.domain.Content__static_init
    //#content.java:: end of class: net.sourceforge.pebble.domain.Content
