//# 0 errors, 52 messages
//#
/*
    //#model.java:1:1: class: net.sourceforge.pebble.web.model.Model
    //#model.java:1:1: method: net.sourceforge.pebble.web.model.Model.net.sourceforge.pebble.web.model.Model__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.web.model;

import java.util.HashMap;
import java.util.Set;

/**
 * Represents the model in web MVC.
 *
 * @author    Simon Brown
 */
public class Model {
    //#model.java:42: method: void net.sourceforge.pebble.web.model.Model.net.sourceforge.pebble.web.model.Model()
    //#input(void net.sourceforge.pebble.web.model.Model()): this
    //#output(void net.sourceforge.pebble.web.model.Model()): new HashMap(Model#1) num objects
    //#output(void net.sourceforge.pebble.web.model.Model()): this.data
    //#new obj(void net.sourceforge.pebble.web.model.Model()): new HashMap(Model#1)
    //#post(void net.sourceforge.pebble.web.model.Model()): this.data == &new HashMap(Model#1)
    //#post(void net.sourceforge.pebble.web.model.Model()): new HashMap(Model#1) num objects == 1

  private HashMap data = new HashMap();
    //#model.java:44: end of method: void net.sourceforge.pebble.web.model.Model.net.sourceforge.pebble.web.model.Model()

  /**
   * Puts data into the model.
   *
   * @param name    the name of the data
   * @param value   the value
   */
  public void put(String name, Object value) {
    data.put(name, value);
    //#model.java:53: method: void net.sourceforge.pebble.web.model.Model.put(String, Object)
    //#input(void put(String, Object)): name
    //#input(void put(String, Object)): this
    //#input(void put(String, Object)): this.data
    //#input(void put(String, Object)): value
    //#pre[3] (void put(String, Object)): this.data != null
  }
    //#model.java:54: end of method: void net.sourceforge.pebble.web.model.Model.put(String, Object)

  /**
   * Gets data from the model.
   *
   * @param name    the name of the data
   * @return        the value
   */
  public Object get(String name) {
    return data.get(name);
    //#model.java:63: method: Object net.sourceforge.pebble.web.model.Model.get(String)
    //#input(Object get(String)): name
    //#input(Object get(String)): this
    //#input(Object get(String)): this.data
    //#output(Object get(String)): return_value
    //#pre[3] (Object get(String)): this.data != null
    //#post(Object get(String)): init'ed(return_value)
    //#model.java:63: end of method: Object net.sourceforge.pebble.web.model.Model.get(String)
  }

  /**
   * Gets the set of all keys.
   *
   * @return a Set of String instances
   */
  public Set keySet() {
    return data.keySet();
    //#model.java:72: method: Set net.sourceforge.pebble.web.model.Model.keySet()
    //#input(Set keySet()): this
    //#input(Set keySet()): this.data
    //#output(Set keySet()): return_value
    //#pre[2] (Set keySet()): this.data != null
    //#post(Set keySet()): return_value != null
    //#model.java:72: end of method: Set net.sourceforge.pebble.web.model.Model.keySet()
  }

  /**
   * Determines whether the model contains an element with the specified key.
   *
   * @param   key   a String
   * @return  true if an element with the key exists, false otherwise
   */
  public boolean contains(String key) {
    return data.containsKey(key);
    //#model.java:82: method: bool net.sourceforge.pebble.web.model.Model.contains(String)
    //#input(bool contains(String)): key
    //#input(bool contains(String)): this
    //#input(bool contains(String)): this.data
    //#output(bool contains(String)): return_value
    //#pre[3] (bool contains(String)): this.data != null
    //#post(bool contains(String)): init'ed(return_value)
    //#model.java:82: end of method: bool net.sourceforge.pebble.web.model.Model.contains(String)
  }

}
    //#output(net.sourceforge.pebble.web.model.Model__static_init): __Descendant_Table[net/sourceforge/pebble/web/model/Model]
    //#output(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.contains(Ljava/lang/String;)Z
    //#output(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object;
    //#output(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.keySet()Ljava/util/Set;
    //#output(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.put(Ljava/lang/String;Ljava/lang/Object;)V
    //#post(net.sourceforge.pebble.web.model.Model__static_init): __Descendant_Table[net/sourceforge/pebble/web/model/Model] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.contains(Ljava/lang/String;)Z == &contains
    //#post(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object; == &get
    //#post(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.keySet()Ljava/util/Set; == &keySet
    //#post(net.sourceforge.pebble.web.model.Model__static_init): __Dispatch_Table.put(Ljava/lang/String;Ljava/lang/Object;)V == &put
    //#model.java:: end of method: net.sourceforge.pebble.web.model.Model.net.sourceforge.pebble.web.model.Model__static_init
    //#model.java:: end of class: net.sourceforge.pebble.web.model.Model
