com.sptci.prevayler.query
Class Count<S extends PrevalentSystem>
java.lang.Object
com.sptci.prevayler.query.AbstractQuery<Integer,S>
com.sptci.prevayler.query.Count<S>
- All Implemented Interfaces:
- Query
public class Count<S extends PrevalentSystem>
- extends AbstractQuery<Integer,S>
The query for retrieving the total number of objects of the specified
type in the prevalent system.
- Version:
- $Id: Count.java 18 2008-07-20 03:35:47Z sptrakesh $
- Author:
- Rakesh Vidyadharan 2008-05-27
- See Also:
© Copyright 2008 Sans Pareil
Technologies, Inc.
|
Field Summary |
private Class |
cls
The type of object whose total count is required. |
|
Constructor Summary |
Count(Class cls)
Create a new instance of the query for the specified prevalent object
type. |
|
Method Summary |
protected Integer |
query(S system,
Date timestamp)
Execute the query on the prevalent system and return the
total number of objects of cls in the system. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cls
private final Class cls
- The type of object whose total count is required.
Count
public Count(Class cls)
- Create a new instance of the query for the specified prevalent object
type.
- Parameters:
cls - The cls value to use.
query
protected Integer query(S system,
Date timestamp)
- Execute the query on the prevalent system and return the
total number of objects of
cls in the system.
- Specified by:
query in class AbstractQuery<Integer,S extends PrevalentSystem>
- Parameters:
system - The prevalent system that is to be acted upon.timestamp - The timestamp for the query.
- Returns:
- The count of prevalent objects of
cls in the system.