simple.template
Interface Database

All Known Subinterfaces:
Container, Document, Panel, Viewer
All Known Implementing Classes:
Environment, FreemarkerContainer, PageContainer, VelocityContainer

public interface Database

The Database interface is used to represent a source of data for a template. It also serves the purpose of providing a means to to share data between controllers. The database object contains a subset of the methods provided by a Map.

Author:
Niall Gallagher

Method Summary
 boolean contains(java.lang.String name)
          The contains method is used to determine if a mapping exists for the given name.
 java.lang.Object get(java.lang.String name)
          The get method is used to retrieve the value mapped to the specified name.
 java.util.Set keySet()
          To ascertain what mappings exist, the names of all values previously put into thhis database can be retrieved with this method.
 void put(java.lang.String name, java.lang.Object value)
          The put method is used to insert a mapping in the database that pairs the issued name with the issued value.
 void remove(java.lang.String name)
          The remove method is used to remove the named value from the database.
 

Method Detail

put

void put(java.lang.String name,
         java.lang.Object value)
The put method is used to insert a mapping in the database that pairs the issued name with the issued value. The value can be referenced in future by its name.

Parameters:
name - this is the name of the value being inserted
value - this is the named value that is inserted

get

java.lang.Object get(java.lang.String name)
The get method is used to retrieve the value mapped to the specified name. If a value does not exist matching the given name, then this returns null.

Parameters:
name - this is the name of the value to be retrieved
Returns:
returns the value if it exists or null otherwise

remove

void remove(java.lang.String name)
The remove method is used to remove the named value from the database. This method either removes the value or returns silently if the name does not exits.

Parameters:
name - this is the name of the value to be removed

keySet

java.util.Set keySet()
To ascertain what mappings exist, the names of all values previously put into thhis database can be retrieved with this method. This will return a Set that contains the names of all the mappings added to this.

Returns:
this returns all the keys for existing mappings

contains

boolean contains(java.lang.String name)
The contains method is used to determine if a mapping exists for the given name. This returns true if the mapping exists or false otherwise.

Parameters:
name - this is the name of the mapping to determine
Returns:
returns true if a mapping exists, false otherwise