SPT RWT Application API

com.sptci.rwt
Class Category

java.lang.Object
  extended by com.sptci.rwt.Category
All Implemented Interfaces:
Serializable

public class Category
extends Object
implements Serializable

A simple data object used to represent a category under which named queries are stored.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: Category.java 4123 2008-05-25 21:49:01Z rakesh $
Author:
Rakesh Vidyadharan 2007-10-10
See Also:
Serialized Form

Field Summary
private  String name
          The name of the category.
private  Map<String,Query> queries
          The named queries associated with this category.
 
Constructor Summary
Category()
          Default constructor.
Category(String name)
          Create a new instance using the specified name.
 
Method Summary
protected  void addQuery(Query query)
          Add the specified query as a saved instance.
protected  void deleteQuery(Query query)
          Remove the query specified from persistent state.
protected  void deleteQuery(String name)
          Remove the query identified by the specified unique name from persistent state.
 String getName()
          Returns name.
 Collection<String> getNames()
          Returns the unique names that have been used to save queries.
 Collection<Query> getQueries()
          Returns a collection of Query objects that are stored under this category.
 Query getQuery(String name)
          Return the query associated with the specified name.
protected  void setName(String name)
          Set name.
protected  void setQueries(Map<String,Query> queries)
          Set queries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private String name
The name of the category.


queries

private Map<String,Query> queries
The named queries associated with this category.

Constructor Detail

Category

public Category()
Default constructor.


Category

public Category(String name)
Create a new instance using the specified name.

Parameters:
name - The name to use.
Method Detail

getName

public String getName()
Returns name.

Returns:
The value/reference of/to name.

setName

protected void setName(String name)
Set name.

Parameters:
name - The value to set.

addQuery

protected void addQuery(Query query)
                 throws IllegalArgumentException
Add the specified query as a saved instance.

Parameters:
query - The query to add to the saved state.
Throws:
IllegalArgumentException - If the specified name already exists.

deleteQuery

protected void deleteQuery(Query query)
Remove the query specified from persistent state.

Parameters:
query - The query that is to be removed.
See Also:
deleteQuery( String )

deleteQuery

protected void deleteQuery(String name)
Remove the query identified by the specified unique name from persistent state.

Parameters:
name - The unique name assigned to the query.

getQuery

public Query getQuery(String name)
Return the query associated with the specified name.

Parameters:
name - The unique name used to identify the saved query.
Returns:
The saved query instance or null if no such saved query exists.

getQueries

public Collection<Query> getQueries()
Returns a collection of Query objects that are stored under this category.

Returns:
The collection of query instances.

setQueries

protected void setQueries(Map<String,Query> queries)
Set queries.

Parameters:
queries - The value to set.

getNames

public Collection<String> getNames()
Returns the unique names that have been used to save queries.

Returns:
The collection of unique names assigned to queries.

SPT RWT Application API